Primes of form Power Less One

Theorem
Let $m, n \in \N^*$ be natural numbers.

Let $m^n - 1$ be prime.

Then $m = 2$ and $n$ is prime.

Proof
First we note that $\dfrac {m^n - 1} {m - 1}$ is the sum of the geometric progression $\displaystyle \sum_{k \mathop = 0}^{n-1} m^k$, so we can see:


 * $\displaystyle m^n - 1 = \left({m - 1}\right) \sum_{k \mathop = 0}^{n-1} m^k$

... so $m^n - 1$ can not be prime unless $m = 2$.

So, let $m = 2$. Thus $m - 1 = 1$, so:
 * $\displaystyle 2^n - 1 = \sum_{k \mathop = 0}^{n-1} 2^k = 2^{n-1} + 2^{n-2} + \cdots + 2 + 1$

Suppose $n$ is not prime, i.e. $n = r s$ where $r, s > 1$.

Applying Sum of Geometric Progression to $2^r$, we obtain:


 * $\displaystyle 2^{r s} - 1 = \left({2^r - 1}\right) \sum_{k \mathop = 0}^{s-1} {2^{r k}}$

Thus if $n$ is not prime, then neither is $2^n - 1$.

So $2^n - 1$ can be prime only when $n$ is.

Historical Note
The proof that if $n$ is composite, then so is $2^n - 1$ is historically attributed to Cataldi, who gave it in 1603.

Comment
Primes of the form $2^n - 1$ are called Mersenne primes.

They are particularly interesting because there is a convenient algorithm (the Lucas-Lehmer Test) which can determine the primality of such a number with high computational efficiency. Therefore the largest primes known are Mersenne.