Let $x > 1$ and let $n$ be a prime. I'm wondering if a characterization of this is known. That is, what are sufficient and necessary conditions for $$ \dfrac{x^n-1}{x-1} = 1 + x + x^2 + \cdots + x^{n-1} $$ to be a prime number? What are these conditions if we restrict $x$ to be a power of a prime? Note that $n$ can not be composite since otherwise it is easy to show that so is $(x^n-1)/(x-1)$. Thanks in advance.


Not a complete answer; just some thoughts

It is likely to be very difficult to give a necessary and sufficient condition. For $x=2$ you're asking what are the Mersenne primes so I don't expect a (simple) answer in the near future.

Some observations:

  • Every prime $p$ is of that form: $p=\frac{(p-1)^2-1}{(p-1)-1}$
  • $n$ has to be prime. An alternative but perhaps overpowered way to see this is Zsigmondy's theorem, which shows that $\frac{x^n-1}{x-1}$ has at least $\tau(n)-1$ distinct prime divisors (except for a few exceptions that aren't very interesting here), $\tau(n)$ the number of divisors of $n$.
  • This is related to cyclotomic polynomials. In general, $x^n-1$ factors as $\prod_{d\mid n}\Phi_d(x)$. If $n$ is prime, your question is essentially when $\Phi_n(x)$ is prime. From cyclotomic polynomials we know that

    • If $p$ is a prime divisor of $\Phi_n(x)$, then $p\equiv1\pmod n$ or $p\mid n$.

    This does does however not tell us much if we're looking for a necessary condition, because by Fermat we always have $\frac{x^n-1}{x-1}\equiv1\pmod n$ if $n$ is prime. (Unless $n\mid x-1$, but then it's not hard to see that we need $\frac{x^n-1}{x-1}=n$ which is impossible as $\Phi_n(x)>\Phi_n(1)=n$.)

I don't think elementary arguments can rule out non-trivial possibilities of $x$ or $n$. For example, Birkhoff & Vandiver's proof of Zsigmondy's theorem investigates the (primitive) prime divisors of $\Phi_n(x)$ quite well, but their intermediate results seem

  1. strongest for composite $n$ - "a non-primitive divisor of $x^n-1$" is not a very interesting concept if $n$ is prime
  2. trivial if we require that $\Phi_n(x)$ is prime

and

  1. the final conclusion is simply that there is some primitive divisor (by showing that the primitive part of $x^n-1$ is $>1$), but it does not tell us whether this divisor is prime.

Inspecting the proof a bit closer it does not seem that the prime factorisation of $x$ plays any role in the proof, so I can't tell whether anything changes when we require that $x$ is a prime power. I haven't read other proofs of Zsigmondy's theorem (you can start looking here if you're interested) but there may be one that is more closely related to the factorisation of $x$.