(P4 IMO 1998, untreated)

Find all pairs of strictly positive integers $(a, b)$ such that $a^{2} b+a+b$ is divisible by $a b^{2}+b+7$.


Suppose that $(a, b)$ is a solution. We have that $a b^{2}+b+7$ divides $b\left(a^{2} b+a+b\right)-a\left(a b^{2}+b+7\right)=b^{2}-7 a$. In particular, either $b^{2}-7 a=0$ (which gives potential solutions of the form $(a, b)=$ $\left(7 k^{2},(7 k)^{2}\right), k \in \mathbb{N}^{*}$), or $b^{2}-7 a \neq 0$ and $\left|b^{2}-7 a\right| \geq\left|a b^{2}+b+7\right|=a b^{2}+b+7$.

Since $a>0$, then $a b^{2}+b+7 \geq b^{2}+b+7>b^{2}>b^{2}-7 a$. Therefore, $b^{2}-7 a$ must be $0$; otherwise, it cannot be a solution.

If $b=2$ then we want $4 a+9$ to divide $4-7 a$ and thus $4 a+9$ divides $7(4 a+9)+4(4-7 a)=79$ which is a prime number: since $4 a+9>1$, then $4 a+9=79$, which is impossible because 70 is not divisible by 4.

If $b=1$ then $a+8$ divides $1-7 a$ so it divides $7(a+8)+(1-7 a)=57=3 \times 19$. Since $a+8 \geq 8$, either $a+8=19$ which means $a=11$, or $a+8=57$ which means $a=49$.

Conversely, we verify that $(a, b)=\left(7 k^{2},(7 k)^{2}\right)\left(k \in \mathbb{N}^{*}\right),(a, b)=(11,1)$ and $(a, b)=(49,1)$ indeed work, so these are all the solutions.