Finding all primes $p$ satisfying $p=a^2+b^2$ and $p$ divides $a^3+b^3-4$ . 
Determine all primes $p$ such that there exist integers $a, b$ satisfying $p=a^2+b^2$ and $a^3+b^3-4$ is divisible by $p$.

So, $p | ab(a+b)+4$ after writing $a^3+b^3-4=(a+b)(p-ab)-4$ and $p=2$ is a solution if $p|4$. If $p$ doesn't divide $4$, $ab(a+b)\equiv -4 \pmod p$. Also, $p=4m+1$ for some integer $m$ by Fermat's 2-square theorem.It seems like $5$ and $2$ are the only primes that satisfy the conditions but I can't seem to prove it.
I've tried manipulating the stuff around but I'm not getting anything. Can anyone give a small hint? Thanks.

Assume $p>2$, and let $s=a+b$. Then
$$ab=\frac{(a+b)^2-(a^2+b^2)}2\equiv \frac{s^2}2\pmod p.$$
Now,
$$a^3+b^3=(a+b)(a^2-ab+b^2)\equiv (a+b)(-ab)\equiv -\frac{s^3}2\pmod p.$$
This implies that $s^3\equiv -8$ modulo $p$. This means that either $p\mid s+2$ or $p\mid s^2-2s+4$.
In the first case,
$$s\geq p-2\implies p=a^2+b^2\geq \frac{(a+b)^2}2\geq \frac{(p-2)^2}2,$$
which implies $p\leq 5$. In the second case,
$$p\mid s^2-2s+4-p=2ab-2(a+b)+4.$$
Since $p>2$, this means $p\mid ab-a-b+2$, and thus $p\leq ab-a-b+2<ab$. However, $a^2+b^2\geq ab$, so this can't occur.
