# Solve equation in prime numbers

Solve the equation in prime number $$p^3+q^3+1=p^2 q^2.$$

I have found the solutions $$(2,3), (3,2)$$ and need to prove that there are no other solutions. I think that there is an inequality $$p^3+q^3+1\leq p^2 q^2$$ for $$p,q >2$$ but how to prove it.

• your inequality is not right when $p>q^2$, for then $p^3 > p^2 q^2$.
– dyf
Commented Nov 9, 2018 at 20:36

If $$p=q$$ we get $$2p^3+1=p^4$$ so $$p\mid 1$$ which is impossible. So we can assume $$p\ne q$$.

Because of simmetry we can also assume that $$p>q$$.

Now we have $$p^2\mid q^3+1 = (q+1)(q^2-q+1)$$

Case 1: $$p\not{\mid}\;q+1$$, then $$p^2\mid q^2-q+1\implies p^2\leq q^2-q+1 so $$p, a contradiction.

Case 2: $$p\mid q+1$$ then $$p\leq q+1$$ so $$p=q+1$$ (remember that $$p>q$$, so $$p\geq q+1$$). So $$p$$ and $$q$$ are consecutive primes so one is even, so $$q=2$$ and $$p=3$$.

My solution

Case 1. Let $$p \mod 3=q \mod 3=1$$. Then $$p^3+q^3+1=3=0 \mod 3 \neq p^2 q^2=1 \mod 3$$

Case 2 $$p \mod 3=q \mod 3=2$$. Then $$p^3+q^3+1=2+2+1=2 \mod 3 \neq p^2 q^2=1 \mod 3$$

Сase 3. $$p \mod 3=1, q \mod 3=2$$. Then $$p^3+q^3+1=1+2+1=1 \mod 3 \neq p^2 q^2=1 \cdot 2 =2 \mod 3$$

So, must be, say $$p=0 \mod 3 \implies p=3$$. We get the equation $$q^3+28=9 q^2$$ or $$q^3-9 q^2+28=\left( q-2 \right) \left( {q}^{2}-7\,q-14 \right)$$ and $$q=2.$$ By symmetry another solution is $$p=2, q=3.$$

• you have an important error, in Case 3, actually both $p^2, q^2 \equiv 1 \pmod 3,$ therefore $p^2 q^2 \equiv 1 \pmod 3,$ Commented Nov 9, 2018 at 23:14