TITLE: Show that if $n$ is a positive integer and $n|2^n-1$, then $n=1$.
QUESTION [6 upvotes]: I have very limited experience with proofs, and I'm having trouble getting started with this.
This far I've been trying to prove it using the division equation $a=bq+r$, to show that the remainder $r+1$ is never zero for $n>1$ for
$2^n=nq+(r+1)$. Trivial cases are just that, and the part I'm guessing I'm having trouble with is how to generalize that, to apply to any n (if this is even a good way go about this).

REPLY [5 votes]: Assume that $n \neq 1$.
Let $p$ be the smallest prime which divides $n$. Write $n= p^k \cdot l$.
Now, you know that 
$$1 \equiv 2^n \equiv (2^l)^{p^k} \pmod p$$
Use the fact that $a^p \equiv a \pmod p$ to conclude that $ (2^l)^{p^k} \equiv 2^l \pmod{p}$.
This shows that 
$$2^l \equiv 1 \pmod{p}$$
You also know that 
$$2^{p-1} \equiv 1 \pmod{p}$$
This gives that $2^{\gcd (l, p-1)}\equiv 1 \pmod{p}$.
Now, if $\gcd(l, p-1) \neq 1$ it is divisible by a prime $q$. This prime divides $l$ hence $n$, and $q$ also divides $p-1$ and hence is smaller than $p$. But this contradicts that $p$ is the smallest prime dividing $n$.
We can therefore conclude that $\gcd (l, p-1)=1$. 
Thus
$2^1 \equiv 1 \pmod{p} \Rightarrow p\mid 2-1=1$. 
This is a contradiction.