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 $$\frac {m^n - 1} {m - 1}$$ is the sum of the geometric progression $$\sum_{k=0}^{n-1} m^k$$, so we can see:


 * $$m^n - 1 = \left({m - 1}\right) \sum_{k=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:
 * $$2^n - 1 = \sum_{k=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$$. Then:


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

Thus if $$n$$ is not prime, then nor 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$$ was given by Cataldi 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.