## Task A-3.2.

Determine all prime numbers $p$ for which there exist natural numbers $x$ and $y$ such that

$$
\left\{\begin{aligned}
p+1 & =2 x^{2} \\
p^{2}+1 & =2 y^{2}
\end{aligned}\right.
$$
## Solution.

We directly verify that $p=2$ is not a solution. It is clear that $y>x$.

By subtracting the given equations, we obtain $p(p-1)=2(y-x)(y+x)$.

From this, we conclude that

$$
p \mid y+x
$$

since otherwise $p$ would be a divisor of the number $y-x$, and $p-1$ would be a multiple of the number $y+x$, which is impossible (then it would be $p-1 \geqslant y+x>y-x \geqslant p$).

Since $p>y$ (which is evident from the second equation) and $y>x$, we have $2p>y+x$, so it must be $p=y+x$. Then $p-1=2(y-x)$. By eliminating $y$, we get $p+1=4x$, and substituting into the first equation, we easily find the only solution $p=7(x=2, y=5)$.