Divisibility of Mersenne numbers Is there a way to prove that $2$ is the only prime that never divides $2^n-1$ ? Obviously we can ignore all primes that are themselves of this form. Some other examples:
$$5\,|\,2^4-1 \qquad 9\,|\,2^6-1 \qquad 11\,|\,2^{10}-1 \qquad 13\,|\,2^{12}-1 \qquad 17\,|\,2^8-1$$
I checked for all $p<10^6$. Thanks in advance.
 A: You have noted that
$$
3\mid 2^2-1,\quad
5\mid 2^4-1,\quad
7\mid 2^6-1,\quad
11\mid 2^{10}-1,\quad
13\mid 2^{12}-1,\quad
17\mid 2^8-1
$$
and the last one seems an outlier, but since $2^{16}-1=(2^8-1)(2^8+1)$, you still have that $17\mid2^{16}-1$.
Now do you see something? The exponent is the prime number minus $1$.
OK, the conjecture might be that $p\mid2^{p-1}-1$ when $p$ is an odd prime. Does this ring a bell? What about any $a$ with $0<a<p$? Oh, yes, it holds that
$$
a^{p-1}-1\equiv 0\pmod{p}
$$
by Euler's theorem: if $\gcd(a,n)=1$, then $a^{\varphi(n)}\equiv1\pmod{n}$, where $\varphi$ is the totient function. For $p$ a prime, $\varphi(p)=p-1$.
A: See Fermat's little theorem:
https://en.wikipedia.org/wiki/Fermat%27s_little_theorem
Your claim follows with $n=p-1$.
A: Just to offer a simple proof that does not rely on Fermat's little theorem, note that there are only $p$ different remainders possible when dividing by $p$ (whether $p$ is prime or not), so the remainders of $2,2^2,2^3,\ldots$ cannot all be different, i.e., we must have $2^h\equiv2^k$ mod $p$ for some pair of integers $h\lt k$, which means $p$ divides $2^k-2^h=2^h(2^{h-k}-1)$. Now if $p$ is an odd prime, it does not divide $2^h$, so it must divide $2^{k-h}-1$.
