TITLE: Tricky congruence
QUESTION [6 upvotes]: Find all positive integers n such that $2^{n-1}\equiv n-1\pmod n$.
I have proved that no such $n$ exists for even/prime $n$. Now I just need to prove that none exist for odd $n$ and I'm done. (Note: Obviously $n=1$ works since 1 divides any integer)

REPLY [4 votes]: If $n > 1$ is odd, then $n-1$ is even and $> 0$, so if we have
$$2^{n-1}\equiv n-1 \pmod{n},$$
then there is an element (namely $2^{(n-1)/2}$) of order $4$ modulo $n$, and modulo all prime divisors of $n$. Hence all prime divisors of $n$ must be $\equiv 1 \pmod{4}$. Then $n \equiv 1 \pmod{4}$, and $2^{(n-1)/4}$ is an element of order $8$ modulo all prime divisors of $n$. Hence all prime divisors of $n$ must be $\equiv 1 \pmod{8}$, and then $n\equiv 1 \pmod{8}$. Then $2^{(n-1)/8}$ is an element of order $16$, $\dotsc$ ad infinitum.