5. Find all pairs $(x ; y)$ of natural numbers for which both numbers $x^{2}+8 y ; y^{2}-8 x$ are perfect squares.
Answer. $(x ; y)=(n ; n+2)$, where $n$ is a natural number, as well as (7; 15), (33; 17), $(45 ; 23)$.

Solution. It is easy to verify that pairs of the form $(n ; n+2)$, where $n$ is a natural number, satisfy the condition of the problem. Let $(x ; y)$ be any other pair satisfying the condition of the problem. Consider two cases.

a) Suppose first that $yx+2$, i.e., $x4$, and we have $(y-4)^{2}=y^{2}-$ $8(y-2)<y^{2}-8 x<y^{2}$. Therefore, $y^{2}-8 x=(y-k)^{2}$, where $k \in\{1 ; 2 ; 3\}$. Again, only the case $k=2$ (by parity) is possible, so $y=2 x+1$. Let $x^{2}+16 x+8=b^{2}$, then $x=\frac{-16 \pm \sqrt{256-4\left(8-b^{2}\right)}}{2}=-8 \pm \sqrt{56+b^{2}}$. It has been shown above that the number under the root is a perfect square only when $b=5$ or $b=13$. Then $x=1$ or $x=7$. We get the pairs $(1 ; 3)$ and ( $7 ; 15)$, the first of which is included in the set $\{(n ; n+2)\}$.

Comment. Correct solution - 20 points. Pairs $(n ; n+2)$ are found, and there is some progress in investigating other cases - 10 points. For any number of found answers, if it is not proven that there are no other solutions, no more than 10 points. Only pairs $(n ; n+2)$ are found - 5 points. Only pairs $(n ; n+2)$ for even or odd $n-2$ points. Only individual solutions satisfying the condition $y=x+2,-1$ point. The solution is incorrect or absent - 0 points.

## Variant 4