Are Mersenne prime exponents always odd?

Theorem. If $2^n-1$ is prime then $n$ is prime.

Proof. Suppose that $2^n-1$ is prime, and write $n=st$ where $s,t$ are positive integers. Since $$x^s-1=(x-1)(x^{s-1}+x^{s-2}+\cdots+1)\ ,$$ we can substitute $x=2^t$ to see that $2^t-1$ is a factor of $2^n-1$. Since $2^n-1$ is prime there are only two possibilities, $$2^t-1=1\quad\hbox{or}\quad 2^t-1=2^n-1\ .$$ Therefore $t=1$ or $t=n$. We have shown that the only possible factorisations of $n$ are $n\times1$ and $1\times n$. Hence, $n$ is prime.

Comment. If $n$ is prime it is not always true that $2^n-1$ is prime. For example, $2^{11}-1=23\times89$.


Note that for $m\ge 2$ $$2^{2m}-1=(2^m)^2-1=(2^m-1)(2^m+1)$$ is not a prime number.


Yes, the formula $2^n-1$ may only yield a prime if $n$ is prime, therefore the only even value of $n$ which yields a prime is $2$, which yields the Mersenne prime $2^2-1=3$. However for some prime values of $n$ the result is not prime, for example $2^{11}-1=23\cdot 89$.

In general $a^x-1$ is composite if $x$ is composite. This can be seen very easily by writing out the numbers in the base $a$. The number will have $x$ digits, and where $x$ is composite, possible factorisations involving $a^y-1$ (where $y$ is a factor of $x$) become obvious.

$2^4-1$ in binary is $1111$ which can be factored as $101\cdot 11$

$2^{15}-1$ in binary is $111 111 111 111 111$ which can be factored as $1001001001001 \cdot 111$ or $10000100001 \cdot 11111$


$10^8-1$ is $99999999$ in decimal which can be factored as $1010101 \cdot 99$ or $10001 \cdot 9999$. For $a$ greater than $2$ we can also separate out the factor $a-1$ (in this case, $9$): $9 \cdot 1010101 \cdot 11$ or $9 \cdot 10001 \cdot 1111$

As an aside, the presence of $a-1$ as a factor means that all $a^x-1$ with $a>2$ and $x>1$ are composite.