TITLE: Diophantine equation involving prime numbers : $p^3 - q^5 = (p+q)^2$
QUESTION [13 upvotes]: Find all pairs of prime nummbers $p,q$ such that $p^3 - q^5 = (p+q)^2$.
It's obvious that $p>q$ and $q=2$ doesn't work, then both $p,q$ are odd. Assuming $p = q + 2k$ we conclude, by the equation, that $k|q^3 - q - 4$ because $\gcd(k,q)=1$ (else $p$ is not prime) and $k=1$ has no solution.
I also tried to use some modules, but I couldn't.

REPLY [2 votes]: At least one of $p,q$ is $3$. If not, then by little Fermat $p^2\equiv q^2\equiv 1,\, p^3\equiv p,\, q^5\equiv q\pmod{\! 3}$, so
$$p^3-q^5\equiv (p+q)^2\iff p-q\equiv 2+2pq$$
$$\iff pq+p-q+1\equiv 0\iff (p-1)(q+1)\equiv 1\pmod{\! 3}$$
For LHS to be non-zero, $p\equiv -1,\, q\equiv 1\pmod{\! 3}$, but still congruence doesn't hold.
$p^3>q^5$, so $p\neq 3$. Then $q=3$ and $p\ge 7$. $$p^3-p^2-6p-(3^5+9)=0,$$
so $p\mid 3^5+9\iff p\mid 3^3+1=28\iff p=7$; $\,(p,q)=(7,3)$ works.