<s>[INST] IMO problem 4, $1998$ Determine all pairs $(a, b)$ of positive integers such that $ab^{2} + b + 7$ divides
$a^{2}b + a + b$. I really have no idea where to start with this. This is the first IMO problem that I attempted, because it looked to be the easiest, but I honestly have no idea where to begin. Any help or hints would be appreciated.
 [/INST] I've got a different solution to the one offered here already. 
If $ab^2+b+7 \mid a^2b+a+b$, then $ab^2+b+7 \mid b(a^2b+a+b) - a(ab^2+b+7) = b^2-7a$
Now there are three cases left to check:


*

*$b^2-7a = 0$. This yields the infinite set of solutions $(a,b) = (7k^2, 7k)$, where $k\ge1$

*$b^2-7a > 0$. Hence, we have $ab^2+b+7 \le b^2-7a <b^2< ab^2+b+7$, a contradiction, so no solutions. 

*$b^2-7a < 0$. Hence, we have $ab^2+b+7 \le 7a-b^2 \Rightarrow a(b^2-7) \le -b^2-b-7$. The RHS is negative, and since $a > 0$ we must have $b^2-7 <0 \Rightarrow b=1$ or $2$. Checking these cases individually we get two more solutions: $(a, b) = (11, 1), (49, 1)$.


Therefore, the solutions are $(a, b) = (11, 1), (49, 1), (7k^2, 7k)$
</s>