# Take a cube, add one, when is this a prime?

Take $$p = n^3 + 1$$

I just realised, checking some numbers, that this only occurs for $n=1$. I was wondering if there is some general proof for this?

You can factorize $n^3+1$, so: $$p= (n+1)(n^2-n+1)$$ so $n+1 = 1$ (so $n=0$) or $n^2-n+1=1$ (so $n(n-1)=0$...)
• As an extension to this, $n^2 - 1$ is also never a prime unless $n=2$. Is there a general proof for $p = n^y + z$, more specifically between $y$ and $z$. – John Miller Sep 17 '18 at 16:53
• It's also worth mentioning that $n+1$ or $n^2 - n + 1$ could be $-1$, although in this case that doesn't add solutions. – Mnemonic Sep 17 '18 at 20:43
• To the proposer: Regarding $n^y+z$ in general I'm pretty sure there isn't any known general method. I think that even the case $n^2+1$ is unsolved. But if $z=1$ and if $y$ is divisible by an odd prime $p$ then the number $n^y+z=n^y+1$ has $n^{y/p}+1$ as a factor by the same method as in this Answer. – DanielWainfleet Sep 18 '18 at 2:28
You can make your understanding stronger by the fact for any odd number $$k > 1$$ and $$n > 1$$, the number $$p = n^k + 1$$ is never a prime because it is divisible by $$n+1$$. The cubes or $$k = 3$$ is a special case of this.
• but $p = 1^k + 1$ is prime for all $k$. – Michael Anderson Sep 18 '18 at 1:49