Find all natural solutions $(a, b)$ such that $(ab - 1) \mid (a^2 + a - 1)^2$.

Find all natural solutions $(a, b)$ such that $$\large (ab - 1) \mid (a^2 + a - 1)^2$$

We have that $$(ab - 1) \mid (a^2 + a - 1)^2 \implies (ab - 1) \mid [(ab)^2 - ab^2 - b^2]^2$$

$$\iff (ab - 1) \mid (ab^2 + b^2 + 1)^2 \iff (ab - 1) \mid (b^2 + b + 1)^2$$

I'm trying to prove that $(ab - 1) \mid (a + b - 1)^2$, yet I don't know how with the information presented.

Assuming that I know how to determine that $(ab - 1) \mid (a + b - 1)^2$. Let $$(a + b - 1)^2 = k(ab - 1), k \in \mathbb Z^+ \tag 1$$

where $(a, b)$ is the solution in which $a + b$ is at its minimal value.

$$\iff a^2 - [(k - 2)b + 2]a + [(b - 1)^2 + k] = 0$$

We have that the equation $$x^2 - [(k - 2)b + 2]a + [(b - 1)^2 + k] = 0$$ has two solutions $x = a$ and $x = a'$ such that $$a + a' = (k - 2)b + 2, aa' = (b - 1)^2 + k$$

It can easily be deduced that $a' \in \mathbb Z^+ \implies (a', b)$ is a solution to $(1)$

$\implies a' + b \ge a + b \iff a' \ge a \implies \dfrac{(b - 1)^2 + k}{a} \ge a \iff (b - 1)^2 + k \ge a^2$

It seems to me that there are infinitely many solutions, which are all consecutive elements in a sequence.

Furthermore, the assumption that $(ab - 1) \mid (a + b - 1)^2$ is incorrect. So I don't know what to begin from here.


Let $(a,b)$ be a solution of $$ (ab - 1) \mid (a^2 \pm a - 1)^2$$ then $(b,c)$ is a solution of $$ (bc-1) \mid (b^2 \mp b - 1)^2,$$ where $$c=\frac{(b^2\mp b-1)^2+ab-1}{b(ab-1)}.$$

Proof

Let $N=ab-1$. Then $0\equiv (a^2b^2\pm ab^2-b^2)^2\equiv (b^2\mp b-1)^2$ (mod $N$). Therefore $(b^2\mp b -1)^2=NM$ for some natural number $M$. Then $M\equiv -1$ (mod $b$) and so there is a natural number $c$ such that $M=bc-1.$

Application

This gives us a formula for generating solutions with every other iteration giving a solution of the original equation. Solutions $(a,a+1)$ just cycle round but the solution $(2,1)$ generates an infinite set of solutions containing those obtained by @MartinR.

In fact all solutions other than $(a,a+1)$ are generated from $(2,1)$.

A proof there are no other solutions

Let $$(a^2\pm a-1)^2=(ab-1)(ac-1).$$ If either $b$ or $c$ is less than $a$ then the described procedure can be used to give us a smaller solution. Otherwise we have $b,c\ge a$.

If $b=a$ then, for $N=ab-1$, we have $a^2\equiv 1$ (mod $N$) and then $a\equiv 0$ (mod $N$). The only possibility is $N=1$ and we have reached the base case.

Otherwise $b,c\ge a+1$ and the only possibility is $b=c=a+1$.

The solutions are as follows

$$\begin{matrix} (2, 13)&& (13, 74)\\ (74, 433)&& (433, 2522)\\ (2522, 14701)&& (14701, 85682)\\ (85682, 499393)&& (499393, 2910674)\\ (2910674, 16964653)&& (16964653, 98877242)\\ \end{matrix}$$

$$\cdots$$

As described in the above answer every other pair gives a solution of the original equation. The remaining pairs if reversed also give solutions but these simply form part of the other solutions. E.g. $(2,13)$ and $(74,433)$ are successive solutions. $(74,13)$ is also a solution which is the 'other half' of the $(74,433)$ one.Viz. $$(74^2+74-1)^2=(74\times 13-1)(74\times 433-1).$$