TITLE: Prove that $n|2^{(n-1)!}-1$ for any $n = 2k + 1$ given $k$ is a natural number
QUESTION [5 upvotes]: What i have done so for:

$2^{(n-1)!} \equiv 1 (mod\hspace 1 mmn)$
Thought about wilson`s theorem but $n$ is not a prime.
Tried to break the factorial and reduce the congruence to $2^{(n-2)!}$ but not sure this is the right way to do.

Any advice would be highly appreciated.

REPLY [6 votes]: If $n$ is odd, then surely $(2,n)=1$. So you can use Fermat's Little Theorem(Euler's Generalization).
And also, $\phi(n)<n$ holds, so $\phi(n)\mid(n-1)!$.
Let $(n-1)!=m\phi(n)$, then $2^{(n-1)!}=2^{m\phi(n)}=(2^{\phi(n)})^m\equiv1^m=1\pmod n$.