# Is $7$ the only prime followed by a cube?

I discovered this site which claims that "$7$ is the only prime followed by a cube". I find this statement rather surprising. Is this true? Where might I find a proof that shows this?

In my searching, I found this question which is similar but the answers seem focused on squares next to cubes.

Any ideas?

-
Factor $x^3-1$. – Byron Schmuland Feb 10 '14 at 16:27
More generally, for each $k$, there is at most one prime that is followed by a $k$-th power: that number is $2^k-1$, but it is not always a prime: you need $k$ prime but not all primes $k$ give a prime $2^k-1$. See Mersenne prime. – lhf Feb 10 '14 at 16:34
Of course the above comments are related to the fact that the polynomial $x^k-1$ has $x=1$ as a root, and so $x-1$ divides that polynomial. – Jeppe Stig Nielsen Feb 10 '14 at 20:22
It keeps surprising me how such simple (I'm sorry for the bad choice of words) questions are likely to get upvoted, as do the answer that are given, while there are much more valuable questions asked before on MSE. – barto Feb 10 '14 at 20:35
@barto I definitely did not expect this question to be received so positively. I also did not expect it to be a simple answer, but I'm not as deep into mathematics as the users here. One thing to always remember on SE sites is that your average users (at least the ones asking questions) are probably not an experts. While you may have great questions/answers exploring the mysteries of mathematics, the likelihood I understand it is low so I am unlikely to vote on those. Also, simple questions can lead to clever, simple answers. – David Starkey Feb 10 '14 at 20:55

This is certainly true. Suppose $n^3 - 1$ is prime, for some $n$. We get that $n^3-1 = (n-1)(n^2 + n + 1)$ and so we have that $n-1$ divides $n^3 - 1$. If $n-1>1$ then we're done, as we have a contradiction to $n^3 - 1$ being prime.

-
@Tomas: this is a fairly standard sort of argument, the kind you would learn how to write down in any good course in elementary number theory. Many textbooks cover this and related topics. – Qiaochu Yuan Feb 10 '14 at 23:59
it puzzles me how this deserves a great answer badge comparing to answers like this math.stackexchange.com/questions/218131/… which needed some serious thinking. I am not saying the answer is not a good one, but it is almost utterly trivial. – Lost1 Feb 11 '14 at 13:35
@Lost1: just there are more people able to undestand this one – Sergey Grinev Feb 11 '14 at 14:06
@Lost1 Congratulations, you've just observed that voting system of SE is screwed globally. (Still, it seems to quite well achieve to find local maxima). – yo' Feb 11 '14 at 14:51
@Lost1 may be connected to the number of views - in turn may be connected with the fact that this is a Hot Network Question. – pnuts Feb 11 '14 at 14:57

$$x^3 - 1 = \underbrace{(x-1)(x^2+x+1)}.$$ Being a product of two numbers, the expression over the $\underbrace{\text{underbrace}}$ is composite UNLESS $(x-1)=1$. That happens only if $x=2$, so $x^3=8$.

-
While both sides of the equation are always equal, x^3-1 cannot be a prime if it is equal to the multiplication of 2 numbers unless 1 of them is a 1. So x-1=1 when x is 2. While (x^2 + x + 1) = 1 when x = 0 or -1 they do not produce a positive integer when put into (x^3-1) and so cannot be prime either. – BeowulfNode42 Feb 11 '14 at 15:55
This answer is easier to understand than the accepted one by @pgadey. I mean, what does "If n−1 > 1 We're done" mean? Shouldn't it be more like "n must equal 2 for n-1 to be 1, hence not a prime"? – NicolasMiari Feb 12 '14 at 6:40
@snulty : It appeared that I had answered hastily after failing to read the question carefully enough. – Michael Hardy Jul 16 '14 at 18:19

Key Idea $\$ Composite polynomials take composite values (except for finitely many values)

Indeeed, suppose that $\ f(x)\color{#c00}{\ne 0}\$ is a composite polynomial: $\, f(x) = g(x)h(x)\,$ with $\ g,\,h\color{#c00}{\ne \pm1}.\,$ Then $\, f(n) = g(n)h(n)\,$ is a composite integer if $\,g(n),\,h(n)\,\neq\, 0,\,\pm1.\,$ The possible exceptions to this are  finite  in number:  when $\,n\,$ is a root of $\ g,\, h,\, g\pm1,\,$ or $\, h\pm1, \,$ all of which are $\color{#c00}{nonzero}$ polynomials, hence have finite sets of roots. $\$ QED

Remark $\$ For a specific composite polynomial $\,f = gh\,$ this yields a simple algorithm to enumerate its finitely many prime values: test if $\,f(n)\,$ is prime as $\,n\,$ ranges over the roots of $\,g\pm1\,$ or $\,h\pm1.\,$ Applying this to $\, f = x^3-1 = (x-1)(x^2\!+x+1)\,$ quickly yields the sought result.

Hence the method used in the other answers is a special case of a method that works generally. Furthermore, this is an instance of a general philosophy relating the factorizations of polynomials to the factorizations of their values (see said answer for much more on this viewpoint).

-
@Downvoter If something is not clear then please feel welcome to ask questions and I will be happy to elaborate. – Bill Dubuque Feb 10 '14 at 22:37
I did not downvote, but, imo, someone with 108k reputation should not post an answer to a clearly overrated question 2 hours after 3 answer have not emerged, and your proof is an overkill. Given that the OP has asked the question, it is pretty clear your answer is unlikely to be accessible for his level of mathematics. – Lost1 Feb 11 '14 at 13:38
@Lost1 Answers teach many readers besides the OP. My sole motivation here is to teach math (not to play the SE rep game). This is a perfect teaching opportunity - a simple problem whose key ideas lead to many interested related results, including deep open problems (follow the links). This is one of the tantalizing aspects of number theory - that simple looking problems often encode deep, interesting math. Things like this are what sparked me to study number theory. I strive to pass along the mathematical torch, hoping that it will similarly spark others, for there lies much beauty. – Bill Dubuque Feb 11 '14 at 14:56
I agree with you, Bill Dubuque. Having read other answers of you I've noticed that you quite often want to show an underlying, more global concept. I appreciate this style of answering (some do not apparently, which I can understand), but perhaps this time you are a little exagerating. – barto Feb 11 '14 at 20:24
@barto I'm not exaggerating. The study of this and related matters leads quickly to interesting and challenging unsolved problems in number theory, such as nonlinear analogs of Dirichlet's theorem on primes in progressions (e.g. Bunyakovsky's conjecture). Any methods that solve these or related problems would probably lead to major breakthroughs. See Chapter 6 of Ribenboim's The New Book of Prime Number Records for a very readable discussion on this. – Bill Dubuque Feb 11 '14 at 20:48

You want to know when $x^3-1$ is prime. This expression can be written as $(x-1)(x^2+x+1)$, So it is always divisible by $(x-1)$. If a prime is divided by $(x-1)$, so $x-1=1$ or $x=2$ and $x^3-1=7$.

-

Wouldn't $-2$ also be a prime followed by $-1$ which is a cube of $-1$. As $x^2 + x +1$ will also equal one for $x=-2$.

-
Negative integers can not be prime. – Zafer Cesur Feb 10 '14 at 19:46
@Zafer: It is very common to take the point of view that $-p$ is prime whenever $p$ is. – MJD Feb 10 '14 at 20:05
You could make the same argument for x=0 but to my understanding primes are positive integers larger than 1. – David Starkey Feb 10 '14 at 20:17
While in ring theory the additive inverses of primes are also considered to be prime, the context of the question and the linked site are most likely only referring to positive natural numbers. – rschwieb Feb 10 '14 at 20:20
This interpretation depends on your definition of "followed by." I take it to mean "moving away from zero," not "increasing toward positive infinity." – Greg Feb 10 '14 at 23:43

## protected by Michael Greinecker♦Feb 12 '14 at 8:30

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site.