<s>[INST] Find all pairs of prime numbers $p$ and $q$ Find all pairs of prime numbers $p$ and $q$ such that $p^3 - q^5 = (p + q)^2$. Present your answers as an ordered pair $(p, q)$.
Is this resolution correct?
It suffices to show that one of $p$, $q$ is divisible by 3, then the rest of the problem collapses.
Assume otherwise. Observe that for any $n$, $n^3 \equiv n \pmod{3}$. So:
$$p^3-q^5 \equiv p-q \equiv p^2+2pq + q^2 \pmod{3}$$Since $p$, $q$ are not divisible by 3, they cannot have residue 0 when squares, so they must both have residue 1 when squared. We have:
$$p-q \equiv 2+2pq$$$$2p-2q \equiv 1+pq$$$$q-p \equiv 1+pq$$$$pq+p-q-1 \equiv 1$$$$(p-1)(q+1) \equiv 1$$Neither $p-1$, $q+1$ can be 0 mod 3, that would be absurd. They are either both congruent to $2$ mod 3, or both congruent to $1$ mod 3. Either case will lead to one of $p$, $q$ being divisible by 3, contradiction.
 [/INST] That looks correct to me. You can also establish the result by looking at $(p+q) \pmod{3}$. As you said, $p^3-q^5\equiv p-q\equiv (p+q)^2\pmod{3}$.
Case 1. $p+q\equiv 0\pmod{3}$. Then you have $3\mid p-q$ and $3\mid p+q$, which gives $3\mid p,q$.
Case 2. $p+q\equiv \pm1\pmod{3}$. Then $(p+q)^2\equiv 1\equiv p-q \pmod{3}$. Subtracting or adding (depending on $\pm$) the congruences $p+q\equiv \pm1\pmod{3}$ and $p-q\equiv 1 \pmod{3}$ will produce $3\mid p$ or $3\mid q$.
So the only solution is $(p,q)=(7,3)$.
</s>