Solve $p^3=p^2+q^2+r^2$ where $ p , q $ and $r$ are prime numbers. The question is pretty self-explanatory.I was wondering how this equation could be solved using "number theory".
 A: Partial solution
Note that $$p^3=p^2+q^2+r^2$$ implies that one of the numbers is equal to $3$, because if all of them are coprime with $3$ then $\mp1\equiv 1+1+1\mod 3$ which is absurd.
The case $p=3$ is easy, 
The two remaining cases are symmetric , wa can assume that WLOG that $q=3$ then: $p^3-p^2=9+r^2$
A: The only deep result we need is the fact that primes congruent to $3$ mod $4$ remain primes as Gaussian integers.
To begin, it's easy to show that there are no solutions if $2$ is used as one (or more) of the primes; in particular, $8=4+q^2+r^2$ and $p^3=p^2+4+4$ have no solutions.  So $p$, $q$, and $r$ are all odd.  This implies
$$p\equiv p^3=p^2+q^2+r^2\equiv1+1+1=3\mod4$$
But writing the equation now as
$$p^3-p^2=q^2+r^2$$
implies $p\mid q\pm ir$ since $p$ is prime as a Gaussian integer, so we have $p\mid q$ and $p\mid r$, which is to say (since $q$ and $r$ are also primes), $p=q=r$.  It quickly follows that $p^3=3p^2$ implies $p=q=r=3$ is the only solution.
Strictly speaking it's not necessary to invoke Gaussian integers; it suffices to know that $-1$ is not a quadratic residue mod $p$ if $p\equiv3$ mod $4$.  
