Prime numbers $pFind the prime numbers $p<q<r$ such that $r^2-q^2-p^2$ is a perfect square.  
I think the only solution is (2,3,7) but i cannot prove it.
The equation would be $r^2-q^2-p^2=k^2$ equivalently
$q^2+p^2+k^2=r^2$ which is somehow a classical diophantine equation (of the pythagorean quadruples) which have a parametrization but how do i use it? The problem is from a magazine at 8 th grade and i don't think the solution is supposed to use the general solution.
Actually the general solution of $q^2+p^2+k^2=r^2$ is given by:
$ q=a^2+b^2-c^2-d^2$
$p=2(mq+np)$
$k=2(nq-mp)$
$r=a^2+b^2+c^2+d^2$
IT would follow that one of the numbers q or p is even and prime, so it is 2.

Hint

All prime numbers $p\geq5$ satisfy $p\equiv \pm 1\mod 6$

Therefore, if $p,q,r\geq5$
$$r^2-q^2-p^2\equiv (\pm1)^2-(\pm1)^2-(\pm1)^2\equiv 1-1-1\equiv5\mod 6$$
Observe now, that there's no perfect square with the residue $5$ modulo 6.
This follows from the simple fact that (taking the equations modulo $6$)
$$\begin{array}l 1^2\equiv\color{red}1\\ 2^2\equiv \color{red}4\\ 3^2\equiv9\equiv\color{red}3\\4^2\equiv16\equiv \color{red}4\\5^2\equiv25\equiv \color{red}1 \\6^2\equiv\color{red}0\end{array}$$
Can you end it now? 
