$n$ is prime if $M_n\equiv 1\pmod{n}$

67 Views Asked by At

Let $M_n$ the $n$-th Mersenne number (A000225). I am trying to prove that if n is prime then $2^n-1=M_n\equiv 1\pmod{n}$. I'm sure it should be easy to get out of fermat's little theorem ($c^{n-1}\equiv 1\pmod{n}$,being careful with them Carmichael Numbers A002997) but I can't see the proof, hopefully someone can give me a hint.

I would also like to know if this result has a specific name (treating it as a primality test)

1

There are 1 best solutions below

0
On BEST ANSWER

If you want to show $n\in\Bbb P\Rightarrow M_n\equiv1\pmod n$, then you don't have to think about Carmichael number. It can directly proved by Fermat's Little Theorem. $$M_n=2^n-1=2(2^{\phi(n)})-1\equiv2-1=1\pmod n$$

But inverse is not true. The counter-example are Carmichael numbers. For example, $2^{561}\equiv2\pmod{561}$, so $M_{561}\equiv 1\pmod{561}$, but $561$ is not prime.