
94.4. Determine all positive integers $n<200$, such that $n^{2}+(n+1)^{2}$ is the square of an integer.


Solution. We determine the integral solutions of

$$
n^{2}+(n+1)^{2}=(n+p)^{2}, \quad p \geq 2
$$

The root formula for quadratic equations yields

$$
n=p-1+\sqrt{2 p(p-1)} \geq 2(p-1)
$$

Because $n<200$, we have $p \leq 100$. Moreover, the number $2 p(p-1)$ has to be the square of an integer. If $p$ is odd, $p$ and $2(p-1)$ have no common factors. Consequently, both $p$ and $2(p-1)$ have to be squares. The only possible candidates are $p=9, p=25, p=49$, $p=81$. The respective numbers $2(p-1)$ are $16,48,96$, and 160 . Of these, only 16 is a square. We thus have one solution $n=8+\sqrt{2 \cdot 9 \cdot 8}=20,20^{2}+21^{2}=841=29^{2}$. If $p$ is even, the numbers $2 p$ and $p-1$ have no factors in common, so both are squares. Possible candidates for $2 p$ are $4,16,36,64,100,144$, and 196. The corresponding values of $p-1$ are $1,7,31,49,71,97$. We obtain two more solutions: $n=1+2=3,3^{2}+4^{2}=5^{2}$, and $n=49+70=119,119^{2}+120^{2}=169^{2}$.
