Find all positive integers $n$ such that $n^2+n+43$ becomes a perfect square Find all positive integers $n$ such that $n^2+n+43$ becomes a perfect square.
Since $n^2+n+43$ is odd,if it's a perfect square it can be written as: $8k+1$,then:
$$n^2+n+43=8k+1\Rightarrow\  n^2+n+42=8k\ \Rightarrow\ n(n+1)\equiv6\pmod8$$
So $n$ becomes $2,5,...$ but $5$ doesn't work!!

$n^2+n+43=m^2$ iff $4n^2+4n+172=4m^2$ iff $(2n+1)^2+171=(2m)^2$.
Let $u=2n+1$ and $v=2m$. Then $171 = v^2-u^2 =(v+u)(v-u)$.
Since $171 = 3 \cdot 3 \cdot 19$, we can try all possibilities for $v+u$ and $v-u$ and then find $n$ and $m$.
