# A Diophantine equation with prime powers

Let $p$ and $q$ be prime numbers such that $p^2+p+1=3q^a$: is it true that $a=1$?

This specific equation appears when computing order components of finite groups.

## Not a complete answer but an indication of what is known:

The solutions to your diophantine equation known due to Nagell. I have in front of me Paulo Ribenboim's "My Numbers, My Friends" from which I quote:

Theorem. If $m > 2$, the only non-zero solutions of $X^2 + X + 1 = 3 Y^m$ are $x = 1$ and $x = -2$. If $m = 2$, there are also the solutions $$x = \pm \frac{\sqrt{3}}{4}\left((2+\sqrt{3})^{2n+1} - (2-\sqrt{3})^{2n+1}\right) - \frac{1}{2}$$ for $n =0, 1, \dots$.

The $m = 2$ case is quite clear: multiply through by $4$ and note that the given equation is equivalent to $$(2X+1)^2 - 3(2Y)^2 = -3$$ Put $X' = 2Y$ and $Y' = (2X+1)/3$ so that you get $$X'^2 - 3Y'^2 = 1$$ and $2 - \sqrt{3}$ is the fundamental unit in the real quadratic field $\mathbf{Q}(\sqrt{3})$.

The reference from Paulo's book is:

T. Nagell. Des équations indéterminées $x^2 + x + 1 = y^n$ et $x^2 + x + 1 = 3y^n$. Norsk Mat. Forenings Skrifter, Ser. I, 1921, No. 2, 14 pages. (= 1921a at the end of Chapter 7.)

• In the Pell like case, how do you decide whether $x$ is prime or not, and if so, whether $y$ is also prime? – Geoff Robinson May 19 '15 at 15:31
• I still don't see how to do this with "prime" condition. – knsam May 19 '15 at 16:09
• This sequence is similar to Fibonacci, and we don't know whether there are infinitely many Fibonacci primes. And $n=8$ is another prime solution $x=2288805793$, $y=1321442641$, so any proof would need that as a special case. I don't know a strategy for solving this. – Linus Hamilton May 19 '15 at 16:10
• @LinusHamilton: Your remark is very appropriate. Let me add that the sequence $2^n-1$ is very similar, e.g. it satisfies a similar recursion, and it contains infinitely many primes if and only there are infinitely many even perfect numbers. This is one of the oldest unsolved problems in mathematics. – GH from MO May 19 '15 at 16:54
• The probability that $x$ is prime is $O(1/\log x)=O(1/n)$ and since $y\sim x$, the probability that $y$ is prime is the same. So the probability that $x$ and $y$ are both primes is $O(1/n^2)$. (Of course, I'm making some randomness and independence assumptions that can't be justified, but just to get an idea...) Summing, this suggests that there are only finitely many such solutions. – Joe Silverman May 19 '15 at 16:55

$$313^2 + 313 + 1 = 3\times181^2$$

• "I said nontrivial." (mathoverflow.net/q/27305/2383) – LSpice May 19 '15 at 13:32
• True enough. :) This is the only solution with $p<10^8$. The case $a=2$ should boil down to a Pell-like equation. But I don't want to dig too deep into it without hearing OP's response, as I don't know how (313, 181) and their possible friends apply to finite groups. – Linus Hamilton May 19 '15 at 13:35

Another counterexample for $a=2$: $p=2288805793$, $q=1321442641$.

There are only 2 counterexamples in primes below $10^{5000}$.

• $10^{5\times 10^3}$? – 1.. May 20 '15 at 3:08
• @Turbo: Yes. What is your concern? – Max Alekseyev May 20 '15 at 3:11
• @Turbo: Solutions to the Pellian equation (explained above by knsam) grow exponentially fast, so it is not a big deal to test them all below a bound like $10^{5000}$. In fact, I tested smallest $10^4$ solutions and achieved the bound $10^{5722}$. – Max Alekseyev May 20 '15 at 3:21
• This counterexample was in Linus Hamilton's comment on knsam's (not-a-complete-)answer. – Gerry Myerson May 20 '15 at 3:57
• @GerryMyerson: Oh, I did not notice. Anyway, no search bound was specified explicitly so far, but here it comes. – Max Alekseyev May 20 '15 at 4:05