Determine all prime numbers $p_{1}, p_{2}, \ldots, p_{12}, p_{13}, p_{1} \leq p_{2} \leq \ldots \leq p_{12} \leq p_{13}$, such that

$$
p_{1}^{2}+p_{2}^{2}+\ldots+p_{12}^{2}=p_{13}^{2}
$$

and one of them is equal to $2 p_{1}+p_{9}$.
Obviously, $p_{13} \neq 2$, because the sum of squares of 12 prime numbers is greater or equal to $12 \times 2^{2}=48$. Thus, $p_{13}$ is an odd number and $p_{13} \geq 7$.

We have that $n^{2} \equiv 1(\bmod 8)$, when $n$ is odd. Let $k$ be the number of prime numbers equal to 2. Looking at the equation modulo 8 we get:

$$
4 k+12-k \equiv 1 \quad(\bmod 8)
$$

So, $k \equiv 7(\bmod 8)$ and because $k \leq 12$ we get $k=7$. Therefore, $p_{1}=p_{2}=\ldots=p_{7}=2$. Furthermore, we are looking for solutions of the equations:

$$
28+p_{8}^{2}+p_{9}^{2}+p_{10}^{2}+p_{11}^{2}+p_{12}^{2}=p_{13}^{2}
$$

where $p_{8}, p_{9}, \ldots, p_{13}$ are odd prime numbers and one of them is equal to $p_{9}+4$.

Now, we know that when $n$ is not divisible by $3, n^{2} \equiv 1(\bmod 3)$. Let $s$ be the number of prime numbers equal to 3. Looking at the equation modulo 3 we get:

$$
28+5-s \equiv 1 \quad(\bmod 3)
$$

Thus, $s \equiv 2(\bmod 3)$ and because $s \leq 5, s$ is either 2 or 5. We will consider both cases. i. When $s=2$, we get $p_{8}=p_{9}=3$. Thus, we are looking for prime numbers $p_{10} \leq p_{11} \leq$ $p_{12} \leq p_{13}$ greater than 3 and at least one of them is 7 (certainly $p_{13} \neq 7$), that satisfy

$$
46+p_{10}^{2}+p_{11}^{2}+p_{12}^{2}=p_{13}^{2}
$$

We know that $n^{2} \equiv 1(\bmod 5)$ or $n^{2}=4(\bmod 5)$ when $n$ is not divisible by 5. It is not possible that $p_{10}=p_{11}=5$, because in that case $p_{12}$ must be equal to 7 and the left-hand side would be divisible by 5, which contradicts the fact that $p_{13} \geq 7$. So, we proved that $p_{10}=5$ or $p_{10}=7$.

If $p_{10}=5$ then $p_{11}=7$ because $p_{11}$ is the least of the remaining prime numbers. Thus, we are looking for solutions of the equation

$$
120=p_{13}^{2}-p_{12}^{2}
$$

in prime numbers. Now, from

$$
2^{3} \cdot 3 \cdot 5=\left(p_{12}-p_{12}\right)\left(p_{13}+p_{12}\right)
$$

the desired solutions are $p_{12}=7, p_{13}=13 ; p_{12}=13, p_{13}=17 ; p_{12}=29, p_{13}=31$.

If $p_{10}=7$ we are solving the equation:

$$
95+p_{11}^{2}+p_{12}^{2}=p_{13}^{2}
$$

in prime numbers greater than 5. But the left side can give residues 0 or 3 modulo 5, while the right side can give only 1 or 4 modulo 5. So, in this case, we do not have a solution.

ii. When $s=5$ we get the equation:

$$
28+45=73=p_{13}^{2}
$$

but 73 is not a square of an integer and we do not have a solution in this case.

Finally, the only solutions are:

$\{(2,2,2,2,2,2,2,3,3,5,7,7,13),(2,2,2,2,2,2,2,3,3,5,7,13,17),(2,2,2,2,2,2,2,3,3,5,7,29,31)\}$. NT5 Show that there are infinitely many positive integers $c$, such that the following equations both have solutions in positive integers:

$$
\left(x^{2}-c\right)\left(y^{2}-c\right)=z^{2}-c
$$

and

$$
\left(x^{2}+c\right)\left(y^{2}-c\right)=z^{2}-c
$$

Solution: The first equation always has solutions, namely the triples $\{x, x+1, x(x+1)-c\}$ for all $x \in \mathbb{N}$. Indeed,

$$
\left(x^{2}-c\right)\left((x+1)^{2}-c\right)=x^{2}(x+1)^{2}-2 c\left(x^{2}+(x+1)^{2}\right)+c^{2}=(x(x+1)-c)^{2}-c .
$$

For the second equation, we try $z=|x y-c|$. We need

$$
\left(x^{2}+c\right)\left(y^{2}-c\right)=(x y-c)^{2}
$$

or

$$
x^{2} y^{2}+c\left(y^{2}-x^{2}\right)-c^{2}=x^{2} y^{2}-2 x y c+c^{2}
$$

Cancelling the common terms we get

$$
c\left(x^{2}-y^{2}+2 x y\right)=2 c^{2}
$$

or

$$
c=\frac{x^{2}-y^{2}+2 x y}{2}
$$

Therefore, all $c$ of this form will work. This expression is a positive integer if $x$ and $y$ have the same parity, and it clearly takes infinitely many positive values. We only need to check $z \neq 0$, i.e., $c \neq x y$, which is true for $x \neq y$. For example, one can take

$$
y=x-2
$$

and

$$
z=\frac{x^{2}-(x-2)^{2}+2 x(x-2)}{2}=x^{2}-2 \text {. }
$$

Thus, $\{(x, x-2,2 x-2)\}$ is a solution for $c=x^{2}-2$.