# Find all primes $p$ for which there are integers $n, x, y$ such that $p^n = x^3 + y^3$

I want to find all primes $p$ for which there exist integers $n, x, y$ such that $p^n = x^3 + y^3$. One solution is $p = 2$ because $2^1 = 1^3 + 1^3$. Now I can assume that $p$ is odd, so exactly one of $x$ and $y$ must be odd and another one must be even. Furhtermore $p^n = (x + y)(x^2 - xy + y^2)$, so $x + y = p^k$ and $x^2 - xy + y^2 = p^l$, where $k + l = n$ and $(x + y) | (x^2 - xy + y^2)$. Could you please help me move forward? I don't know what to do next.

• I assume $x=1$, $y=0$, and $n=0$ is not allowed. – Michael Burr Feb 24 '17 at 17:04
• You may want to see here. – S.C.B. Feb 24 '17 at 17:06
• Here's a trivial solution $n=3k,y=0,x=p^k$,though I guess you're not allowing this. – kingW3 Feb 24 '17 at 18:53

Hint Let solution exists => exists a solution with $gcd(x,y) = 1$ => exists a solution with $gcd(x,p) = gcd(y,p) = 1$

in this case: $x+y=p^k,x^2-xy+y^2=p^m => 3xy=p^{2k}-p^m = p^m(p^{2k-m}-1)$ =>$m=0$ or $m=1, p=3$, in other cases $p|xy$

$x^2-xy+y^2=1$ => $x=1, y=1$ (you was found this solution)

$x^2-xy+y^2=3$ => $(x-0.5y)^2+0.75y^2 = 3$ => $y^2 \le 4$

Cases:

1. $y=1,x^2-x=2 =>x=2, x^3+y^3=9$ => it is a solution
2. $y=2, x=1 =>$ same solution

So, (p,n,x,y) is (2,1,1,1), (3,2,2,1) and(3,2,1,2). And multiplying x,y by p series

Explain 1: $gcd(x,y)>1, gcd(x,y)|p^n => p|x, p|y => (p, n-3, \frac{x}{p}, \frac{y}{p})$ is a solution too.

Let $gcd(x,y) = 1, gcd(x,p) = p.$ => $y^3=p^n - p^3c$=>$p|y$ => $gcd(x,y)|p$ -it is absurd

• Could you please explain your hint? I can't see why existance of any solution implies existance of solution with GCD equal to 1. – user128409235 Feb 24 '17 at 18:22
• @user128409235 - edited – kotomord Feb 24 '17 at 18:28
• The problem with this is that virtually all of the solutions correspond to the case (in your notation) $k=0$, i.e. $x+y=1$, where there are almost certainly infinitely many solutions with $m \in \{ 1, 2 \}$, such as e.g. $105^3 +(-104)^3=181^2$. – Mike Bennett Feb 25 '17 at 12:34