TITLE: Prove that if $2^n - 1$ is prime, then $n$ is prime for $n$ being a natural number
QUESTION [10 upvotes]: Prove that if $2^n - 1$ is prime, then $n$ is prime for $n$ being a natural number

I've looked at https://math.stackexchange.com/a/19998

It is known that $2^n-1$ can only be prime if $n$ is prime.  This is because if $jk=n$, $2^n-1=\sum_{i=0}^{n-1}2^i$ $=\sum_{i=0}^{j-1} 2^i \sum_{i=0}^{k-1} 2^{ij}$.

So they will only continue to alternate at twin primes.  In particular, $2^{6k+2}-1, 2^{6k+3}-1$ and $2^{6k+4}-1$ will all be composite
What I dont understand is how do I get:
$$\sum_{i=0}^{n-1}2^i=\sum_{i=0}^{j-1} 2^i \sum_{i=0}^{k-1} 2^{ij}$$
If I am looking at the wrong answer, how can I proof the above?

Then again, maybe I am indeed looking at the wrong thing?

In particular, $2^{6k+2}-1, 2^{6k+3}-1$ and $2^{6k+4}-1$ will all be composite

This doesnt say why $2^{6k+2}-1$ is composite?

REPLY [9 votes]: Consider what $2^n-1$ looks like when written in base 2:
$$ \underbrace{111\cdots\cdots\cdots\cdots1}_{n} $$
If $n$ is not a prime, say $n=ab$, then $2^n-1$ is clearly the product of
$$ \underbrace{111\cdots1}_{a} $$
with
$$ 1\underbrace{\underbrace{00\cdots 0}_{a-1}1
              \underbrace{00\cdots 0}_{a-1}1\cdots1
              \underbrace{00\cdots 0}_{a-1} }_{b-1}1 $$