22

Let $a, b$ be positive integers such that $a(b+1)(ab+1)$ is a perfect square. Then, is it necessarily the case that $(b+1) \mid a(ab+1)$?

Numerical evidence indicates that this conjecture holds for $a, b \le 10\,000$. In the case that the conjecture happens to be false, I would be interested in a heuristic argument or intuition for why the implication is 'usually' true.

Progress

It's easy to see that the conjecture holds in the special case where $b + 1 = p$ is a prime, since if $a(b+1)(ab+1)$ is a perfect square then $p$ must divide it an even number of times. In particular, we have $p^2 \mid a(b+1)(ab+1)$. This argument is easily extended to $b+1$ squarefree.

I'm not sure how to proceed in the general case. I tried setting $d = \gcd(b + 1, ab + 1)$ and writing $b + 1 = kd$, $ab + 1 = sd$ for coprime integers $k, s$. Then the hypothesis can be rewritten as $$ a(b+1)(ab+1)\ \text{is a perfect square} \iff aksd^2\ \text{is a perfect square} \iff aks\ \text{is a perfect square}. $$ By using $\gcd(a, ab+1) = 1$ and $s \mid ab+1$, we see that $a, s$ are coprime. Combining with the fact that $k$ and $s$ are coprime shows that $ak$ and $s$ are coprime, hence are both squares.

On the other hand, the goal is to prove that $$ (b+1) \mid a(ab+1) \iff kd \mid asd \iff k \mid as \iff k \mid a $$ where the last step follows from $k, s$ coprime. I haven't figured out how to make further progress here.

Connections to Pell's equation

Ewan Delanoy remarks in the comments that this problem seems related to Pell's equations. Indeed, I encountered this conjecture while thinking about the following problem Determine all ordered pairs $(m, k)$ for which $f(m, km)$ is a perfect square, which asks to characterize pairs $(m, k)$ such that $$ \frac{km^2(m+1)(km+1)}{4} $$ is a perfect square. A friend showed me a partial solution to this question; the idea is essentially to show that, for fixed $m$, the $k$ that work correspond to solutions of the Pell's equation $i^2 - 4m(m+1)j^2 = 1$. Unfortunately, at one key point the solution assumes a strong divisibility result that we could not justify. Empirically I determined that, in fact, the assumption appears sound and follows from the conjecture here. I have written up the solution to the related problem assuming the present conjecture holds in case it is of interest.

Joe
  • 534
  • 13
  • 3
    Your special case easily generalizes to the case where $b+1$ is square-free. – Kangyeon Moon Aug 10 '25 at 08:07
  • Your claim seems related to Pell equations. It implies the following : for any integer $c\gt 1$, any solution $(x,y)$ to the Pell equation $x^2-(c^2-1)y^2=1$, either $x^2$ or $y^2$ is divisible by $c^2$ (take $a=y^2$, $b=c^2-1$).. – Ewan Delanoy Aug 10 '25 at 15:22
  • @EwanDelanoy that one is true, the continued fraction for $\sqrt {c^2 - 1}$ is $ \langle c-1; 1, 2c-2,1,2c-2, 1, 2c-2... \rangle$ and ... back later – Will Jagy Aug 10 '25 at 15:52
  • 1
    @KangyeonMoon Thanks. Here is a related empirical observation: if $b+1 = p_1\dots p_r$ is squarefree, then one might expect the factors $p_1, \dots, p_r$ to be split amongst $a$ and $ab+1$. (That is, perhaps $p_1, \dots, p_j$ are in $a$, and the rest are in $ab+1$.) However, numerical evidence for $a, b \le 10,000$ indicates exactly one of $b+1 \mid a$ and $b+1 \mid ab+1$ holds: all the factors of $b+1$ seem to be in either $a$ or $ab+1$, not split between the two. Informally it seems that $b+1$ "acts like" a prime obeying Euclid's divisibility lemma. But I stress this is purely empirical. – Joe Aug 10 '25 at 22:24
  • 1
    @EwanDelanoy Thanks. In fact I extracted this conjecture while thinking about a problem related to Pell equations. The context is quite long and it seemed unrelated to this claim at the time, but since you mentioned it I will add in a brief summary as an edit shortly. – Joe Aug 10 '25 at 22:26
  • 1
    For a prime $p$, let $p^\alpha$, $p^\beta$ and $p^\gamma$ be the highest powers of $p$ which divide (respectively) $a$, $b+1$ and $ab+1$. If $b+1$ does not divide $a(ab+1)$, there is a $p$ with $\alpha+\gamma < \beta$.

    Note $(a-1)b=(ab+1) - (b+1)$. The highest power of $p$ dividing this is $\gamma$ since $\gamma<\beta$. Since $\beta > 0$ we get $p\not | b$, so $p^\gamma | (a-1)$.

    If $\gamma\neq0$ then $p$ divides both $ab+1$ and $b$, which is not possible. So $p\not|,(ab+1)$

    I haven't used squareness, but that would force $\alpha+\beta$ to be even. That's as far as I got.

    – Michael Hartley Aug 11 '25 at 03:13
  • You can also prove $a\geq 3$ by noting $a(b+1)(ab+1)$ must be at most $(a(b+1)-1)^2$ unless $a=1$, but I don't see how that helps. – Michael Hartley Aug 11 '25 at 03:56
  • Use p adic valuation. – Guruprasad Aug 11 '25 at 04:11
  • 1
    @Guruprasad That's essentially Michael Hartley's idea. Do you know how to complete it? I think it is quite difficult to get an argument using purely 'local' reasoning at one prime $p$ to work, i.e. produce a contradiction--heuristically it doesn't seem powerful enough. For instance with $a=2$, $b=8$ and $p=3$ (many others), one has $\nu_p(a)=0$, $\nu_p(b+1)=2$, $\nu_p(ab+1)=0$. Deriving from a contradiction from here now seems to require one to show that $a(b+1)(ab+1)$ is not a perfect square, and you can't do this by just looking at the $p$-adic valuation for the specific $p$ we chose. – Joe Aug 11 '25 at 04:18

1 Answers1

12

This answer is now complete. The conjecture is true.

The case $a=1$ of the conjecture is trivial. Suppose we are given $a,b,c$ with $$a(b+1)(ab+1)=c^2$$ and suppose $a>1$. Then $$ \begin{align*} c^2&= a(ab^2+b+ab+1)\\ &=a^2b^2+a(a+1)b+a\\ &=\left(ab+\frac{a+1}2\right)^2-\left(\frac{a+1}{2}\right)^2+a\\ &=\left(ab+\frac{a+1}2\right)^2 - \left(\frac{a-1}{2}\right)^2. \end{align*} $$ Rearranging and multiplying through by $4$, we obtain a Pythagorean triple, $$ \left(2ab+a+1\right)^2 = (2c)^2 + \left(a-1\right)^2. $$ Before we proceed, we need a few Lemmas reminiscent of the famous IMO problem No. 6:


Lemma 1: Let $a,b,N$ be positive integers, $(a,b)=1$, and suppose $$ t:=\frac{(a+b)^2}{Nab+1} $$ is an integer. WLOG, assume $a\ge b$. If $t\neq 1\neq Nb$, there exists an $a>a'\ge 1$ such that $(a',b)=1$ and $$ \frac{(a'+b)^2}{Na'b+1}=t. $$

Proof: We will use Vieta jumping, inspired by this AoPs post. $a$ is a root of the quadratic equation $$ X^2+(2b-tNb)X+(b^2-t)=0. $$ It follows that the other root, $a':=\frac{b^2-t}a$ is also an integer. We will prove it is positive.

First, $a'=0$ implies $t=b^2$ and

\begin{align*} a^2+b^2+2ab &= b^2(Nab+1) = Nab^3+b^2\\ a^2+ a(2b-Nb^3) &=0, \end{align*} so $a=Nb^3-2b^2$. Because $(a,b)=1$, it follows that $b=1$ and $a=N-2$, which implies $t=1$; a contradiction. So $a'\neq 0$.

Next, if $a'\le -1$, we find $t\ge b^2+a$, so
$$ \begin{align*} (b^2+a)(Nab+1) &\le (a+b)^2\\ Nab^3a + Na^2b + b^2+a&\le a^2+b^2+2ab\\ a^2(Nb-1) + a(Nb^3-2b+1)&\le 0, \end{align*} $$ which contradicts $Nb\neq 1$. We conclude that $a'\ge 1$.

Next, suppose $(a',b)\neq 1$. Let $p\mid (a',b)$ be prime, then $p\mid b^2-t$, so $p\mid t$, whence $p\mid a+b$ and this implies $p\mid a$: a contradiction. We conclude $(a',b)=1$.

Finally, $a'a=b^2-t<b^2\le a^2$, so $a>a'\ge 1$. $\square$

Lemma 2: Fix $N\ge 2$. For all $a,b\ge 1$ with $(a,b)=1$ and $$ t:=\frac{(a+b)^2}{Nab+1} $$ an integer, we have $t=1$.

Proof: Assume this is not the case. Let $a,b$ be such that $t\ge 2$ and $a+b$ is minimal. WLOG, $a\ge b$. By Lemma $1$ and the fact that $N\ge 2$, there exists a pair $(a',b)$ such that $$ \frac{(a'+b)^2}{Na'b+1} = t \ge 2 $$ and $a'+b<a+b$, contradicting minimality. $\square$

Lemma 3 Let $a,b\ge 1$ be coprime integers such that $$ t:=\frac{(a+b)^2}{ab+1} $$ is an integer. Then $t\mid a+b$.

Proof: Assume this is false. Let $(a,b)$ be a pair for which $t\nmid a+b$ and $a+b$ minimal.

We see that $t\neq 1$ and $b\neq 1$, so by Lemma $1$, we can find $a'$ such that $(a',b)$ is another pair for which the Lemma is false. To see this, assume for the sake of contradiction that $t\mid a'+b$. Then $t\mid a(a'+b)+t=b^2+ab=b(a+b)$, but $t\mid (a+b)^2$ and $(a,b)=1$, which implies $(t,b)=1$, so $t\mid a+b$, which is a contradiction. We conclude $t\nmid a'+b$.

But $a'+b<a+b$, contradicting minimality. $\square$


Back to the problem at hand. We will use a well-known parametrization of the Pythagorean triples, a proof of which can be found here.

There exist positive integers, $m,n,k$ such that $(m,n)=1$ and $2\mid mn$ and either $$ 2ab+a+1 = k(m^2+n^2),\quad 2c = k(m^2-n^2),\quad a-1 = 2kmn $$ or $$ 2ab+a+1 = k(m^2+n^2),\quad 2c = 2kmn,\quad a-1 = k(m^2-n^2). $$ We will treat these two cases separately. In the first case, $$ 2kmn+1 = a\mid 2ab+a = k(m^2+n^2)-1, $$ so $2kmn+1\mid k(m^2+n^2)-1 + 2kmn+1 = k(m+n)^2$, whence $2kmn+1\mid (m+n)^2$. Applying Lemma $2$ with $N=2k$, we find that $$ 2b+1 = \frac{k(m+n)^2}{2kmn+1} - 1 = k-1, $$ so $2(b+1)\mid k\mid a-1$, which implies $b+1\mid ab+1,$ since $ab+1\equiv 1-a\pmod{b+1}.$

In the second case, we see that $$ k(m^2-n^2) + 1 =a\mid 2ab+a = k(m^2+n^2) - 1, $$ whence $k(m^2-n^2)+1\mid k(m^2+n^2) - 1 + k(m^2-n^2)+1=2km^2$.

Let $u:=m+n$ and $v:=m-n$, then $(u,v)=1$ and $kuv+1\mid k(u+v)^2$, so $kuv+1\mid (u+v)^2$.

Assume for a moment that $k\ge 2$. Applying Lemma $2$ with $N=k$, we obtain $$ 2b+1 = \frac k2\cdot\frac{4m^2}{k(m^2-n^2)+1}-1 = \frac k2-1, $$ so $4(b+1)=k\mid a-1$, which implies $b+1\mid ab+1$.


That just leaves the second case with $k=1$. Here, we apply Lemma $3$ to conclude there exists some integer $r\ge 1$ such that $$ 2b+1 = \frac 12\cdot\frac{4m^2}{k(m^2-n^2)+1}-1 =\frac12 \frac{(u+v)^2}{uv+1}-1=\frac12r-1, $$ where $4(b+1)=r$ and $r\mid u+v = 2m$. We conclude that $b+1\mid m\mid c$.

Write $c=(b+1)d$, then $$ \begin{align*} a(b+1)(ab+1) &= (b+1)^2d^2\\ a(ab+1) &= (b+1)d^2, \end{align*} $$ so $b+1\mid a(ab+1)$.

Mastrem
  • 9,184
  • 4
    Lovely, lovely solution! Thanks for the hard work here, accepted. If you would like to do one last batch of minor edits, I believe at one point in Lemma 1 when deriving a contradiction you write $Nb = 1$ instead of $Nb \ne 1$. A brief note that $b+1 \mid a-1$ implies $b+1 \mid ab+1$ would help clarity as well, I think--it was in your first revision but seems to have been lost in the later edits. Thanks again! – Joe Aug 12 '25 at 00:43
  • 3
    You're welcome :) Really enjoyed working on this. I have made the edits you suggested – Mastrem Aug 12 '25 at 10:30
  • Sorry, one further request for clarification: in the proof of Lemma 3, how do you ensure that $t \nmid a' + b$? I overlooked it earlier since the proof seemed identical to Lemma 2, but I believe this additional condition is necessary for the descent and I haven't managed to figure out how it's justified yet. – Joe Aug 12 '25 at 17:24
  • Ah, figured out how to justify $t \nmid a' + b$. I think one might need to strengthen the statement of Lemma 1 slightly more or otherwise elaborate a bit in the proof of Lemma 3. In particular, by the other one of Vieta's formulas, we have $a + a' = (t-2)b$ and hence $(a + b) + (a' + b) = tb$. Since $t \nmid a+b$, we cannot have $t \mid a' + b$. (As a side remark, Lemma 3 has an interesting connection to this AoPs post which also deals with $(a, b)$ st $ab+1 \mid (a+b)^2$.) – Joe Aug 12 '25 at 23:02
  • 1
    @Joe Correct! Another way to do this: $t\mid a'+b$ implies $t\mid a(a'+b)+t = b(a+b)$, and $(t,b)=1$, because $(a,b)=1$ and $t\mid (a+b)^2$. Therefore, $t\mid a+b$, which is a contradiction. I have edited Lemma 3 accordingly – Mastrem Aug 13 '25 at 00:02