Find all pairs of primes $p,q$

elementary-number-theoryprime numbers

Find all pairs of primes $(P,Q)$ satisfying $$p^{3}-q^{5}=(p+q)^{2}$$
What I have been able to show until now is that
$$q+1<p<q^3+1$$ but I don't see how it's of any use here. Can anyone please suggest something? Thank you.
Apart from this, I can also prove that $p$ and $q$ both are odd. And they must leave the same remainder upon division by $4$.

P.S. i'm not looking for a complete solution…i just need a hint.

Best Answer

Note that

$$p^3 \equiv p \pmod{3}, \; q^5 \equiv q \pmod{3} \tag{1}\label{eq1A}$$

Consider neither $p$ or $q$ being $3$. If $p \equiv q \pmod{3}$, then the left side is a multiple of $3$ but the right side is not. Instead, if $p \not\equiv q \pmod{3}$, then $p + q \equiv 0 \pmod{3}$, so the left side is not divisible by $3$ but the right side is. This means that either $p$ or $q$ is $3$.

Since the question asks for a hint only, the rest of the solution is behind the spoiler below.

Since $3^3 = 27$ means that $q \ge 2 \implies q^5 \ge 32$, the left side would be negative. This only leaves $q = 3$, with this giving

$$\begin{equation}\begin{aligned}p^3 - 3^5 & = (p + 3)^2 \\ p^3 - 243 & = p^2 + 6p + 9 \\ p^3 & = p^2 + 6p + 252 \end{aligned}\end{equation}\tag{2}\label{eq2A}$$

Since $p^3$ grows faster than the right side of \eqref{eq2A}, this leaves only a few possible values of $p$ to check, with $p = 7$ being the only value which works. Thus, the only solution is $(p,q) = (7,3)$.

Related Question