TITLE: BMO1 2011 Problem 1: Find $n$ such that $n^2+20n+11$ is a perfect square
QUESTION [6 upvotes]: Find all (positive or negative) integers
$n$ for which

$$n^2+20n+11$$
is a perfect square. Remember that you must justify that you have found
them all.
For the first part I did so:
$$n^2+20n+11=M^2 $$ where M is an integer.
That factors down to:
$$ (n+10)^2-M^2=89$$
$$ (n+10-M)(n+10+M)=89$$
From there it is easy to find solutions as 89 is prime and it is a diophantine equation.
So the first part of the question is quite simple, however I am completely stumped on how to do the second part, how might we show that those are the only solutions?

REPLY [3 votes]: Let $n^2+20n+11=(n+m)^2$
$\iff n=\dfrac{m^2-11}{2(10-m)}$
So, $m$ must be odd $=2r+1$(say)
$\implies n=\dfrac{2r^2+2r-5}{9-2r}$
Now if integer $d(>0)$ divides both $2r^2+2r-5,9-2r$
$d$ must divide $r(9-2r)+(2r^2+2r-5)=11r-5$
$d$ must divide $11(9-2r)+2(11r-5)=89$
As $n$ is an integer,  $9-2r$ must divide $89$ whose factors are $\pm1,\pm89$