Find all relative prime positive integers $p$ and $q$ such that $p+q=(p-q)^3$.

divisibilityelementary-number-theoryprime numbers

Find all relative prime positive integers $p$ and $q$ such that $p+q=(p-q)^3$.

Attempt:
I divide it into $4$ cases as follows:

  1. both $p$ and $q$ are prime;
  2. $p$ is prime, $q$ is composite;
  3. $p$ is composite, $q$ is prime; and
  4. both $p$ and $q$ are composite.

Here's what I tried for the first case:
I provide two different ways:

First way: Clearly, $p>q$. Since $p-q \equiv 2p \pmod{(p+q)}$, then
$$0 \equiv 8p^3 \pmod{(p+q)}. \tag 1$$
Since $p$ and $q$ are relative prime, then so are $p$ and $p+q$.
Hence, (1) becomes $0 \equiv 8 \pmod{(p+q)}$ so that $(p+q) \mid 8$.
It's not hard to check that the only solution is $(p,q)=(5,3)$.
Verifying back to the original equation, we obtained that $5+3=8=2^3=(5-3)^3$ which is true.

Second way: Let $k=p-q$. Then $k+2q=p+q$ so that $k^3=k+2q$. Hence,
$$k^3=k+2q \implies k(k+1)(k-1)=2q.$$
Since $q$ is prime, then we must have that $k-1=1$, yielding $p-q=2.$ Now, notice that
$$(p-q)^3=p+q \implies p+q=8.$$
Thus, we have $p=5$ and $q=3$.
Therefore, the only solution is $(p,q)=(5,3)$.
Verifying back to the original equation, we obtained that $5+3=8=2^3=(5-3)^3$ which is true.

Now, I have no idea how to show the rest. Anyone could help please? Many thanks in advanced.

Best Answer

Since $p-q\mid p+q$, we have $p-q\mid (p+q)+(p-q) = 2p$ and $p-q\mid (p+q)-(p-q) = 2q$, hence $p-q\mid 2\gcd(p, q) = 2$. We divide cases.

(i) $p-q = 1$: then $p = q+1$, so the equation reduces to $2q+1 = 1^3$, which is impossible.

(ii) $p-q = 2$: then $p = q+2$, and $2q+2 = 2^3 = 8$, $q = 3$. Hence $p=5$, and this is actually a solution.

Thus the only solution is $p=5, q=3$. Note that $p+q>0$ so $p-q>0$, too.

Related Question