TITLE: Prove $n\mid \phi(2^n-1)$
QUESTION [43 upvotes]: If $2^p-1$ is a prime, (thus $p$ is a prime, too) then $p\mid 2^p-2=\phi(2^p-1).$
But I find $n\mid \phi(2^n-1)$ is always hold, no matter what $n$ is. Such as $4\mid \phi(2^4-1)=8.$
If we denote $a_n=\dfrac{\phi(2^n-1)}{n}$, then $a_n$ is A011260, but how to prove it is always integer?
Thanks in advance!

REPLY [6 votes]: Observation. If $2^n-1\mid 2^k-1$ then $n \mid k$.
Proof. Let $2^n-1\mid 2^k-1$. Let $k=qn+r$ where $0\le r<n$. Then we get 
$$2^k-1=2^{qn+r}-1=2^{qn+r}-2^r+2^r-1=2^r(2^{qn}-1)+2^r-1.$$
Since $2^{qn}-1=(2^n-1)(2^{(q-1)n}+2^{(q-2)n}+\dots+2^n+1)$, we see that $2^n-1$ divides $2^{qn}-1$. Therefore $2^n-1$ also divides
$$2^r-1 = 2^k-1 - 2^r(2^{qn}-1).$$
But $2^n-1 \mid 2^r-1$ with $0\le r<n$ is only possible if $r=0$. So we get that $k=qn$ and $n\mid k$. 

From Euler's theorem we have
$$2^{\varphi(2^n-1)}\equiv 1 \pmod{2^n-1},$$
i.e., $2^n-1 \mid 2^{\varphi(2^n-1)}-1$. (Notice that $\gcd(2,2^n-1)=1$, so Euler's theorem can be applied here.) 
Using the above observation for $k=\varphi(2^n-1)$ we get
$$n\mid \varphi(2^n-1).$$
Note: The same argument would work to show that $n\mid \varphi(a^n-1)$ for any $a\ge2$. Some posts about this more general question:

$n\mid \phi(a^{n}-1)$ for any $a>n$?
$n$ divides $\phi(a^n -1)$ where $a, n$ are positive integer.
Prove that $n$ divides $\phi(a^n -1)$ where $a, n$ are positive integer without using concepts of abstract algebra