This site is supported by donations to The OEIS Foundation.

# Mersenne primes

**Mersenne primes**are prime numbers of the form

2^{ p} − 1 |

p |

127 |

2^{ 7} − 1 = 127 |

2^{ 77232917} − 1 |

^{[1]}

The condition is necessary but not sufficient, and to prove the lack of sufficiency you might be satisfied by the example ofTheorem.

For a number of the formto be prime, it is a necessary condition that

2 ^{ n}− 1be prime. This is to say that if

nis composite, then so is

n.

2 ^{ n}− 1

Proof.Consider the powers ofmodulo a number of the form

2 : we have

2 ^{ n}− 1and so on and so forth, showing that an instance of

1, 2, 4, 8, …, 2 ^{ n − 2}, 2^{ n − 1}, 1, 2, 4, 8is encountered periodically at every

1 doubling steps. This means that for any positive integer

n, the congruence

mholds and therefore the number

2 ^{ m n}≡ 1 (mod 2^{ n}− 1)is divisible by

2 ^{ m n}− 1(for example, every fourth Mersenne number starting with

2 ^{ n}− 1is divisible by

15 etc.). If

15: 255, 4095, 65535, 1048575, is composite, it must have at least one divisor apart from

nand itself, and therefore

1 has at least one divisor that is also a Mersenne number (with the exponent corresponding to that divisor of

2 ^{ n}− 1), thus proving that

nis also composite. But if

2 ^{ n}− 1is prime, then

nis divisible by no Mersenne numbers other than

2 ^{ n}− 1and itself, and is thus potentially prime. □

1

2^{ 11} − 1 = 2047 = 23 × 89 = (2 × 11 + 1) × (8 × 11 + 1) |

It is not known whether the set of Mersenne primes is finite or infinite. The Lenstra–Pomerance–Wagstaff conjecture asserts that, on the contrary, there are infinitely many Mersenne primes and predicts their order of growth. There have been less than 50 identified through 2011.

Mersenne primes are interesting for their connection to even perfect numbers. In the 4^{th}century bc, Euclid demonstrated that if

M p |

is an even perfect number. In the 18^{th} century, Leonhard Euler proved that, conversely, all even perfect numbers have this form.

## Contents

## Base 2 repunits

The base 2 repunits (sometimes called Mersenne numbers, although that name usually applies to the next definition) are numbers of the form

### Generating function of base 2 repunits

The ordinary generating function of base 2 repunits is

### Exponential generating function of base 2 repunits

The exponential generating function of base 2 repunits is

## Sequences

A0002252^{ n} − 1, n ≥ 0 |

{0, 1, 3, 7, 15, 31, 63, 127, 255, 511, 1023, 2047, 4095, 8191, 16383, 32767, 65535, 131071, 262143, 524287, 1048575, 2097151, 4194303, 8388607, 16777215, 33554431, 67108863, 134217727, ...}

M p = 2^{ p} − 1 |

p |

{3, 7, 31, 127, 2047, 8191, 131071, 524287, 8388607, 536870911, 2147483647, 137438953471, 2199023255551, 8796093022207, 140737488355327, 9007199254740991, 576460752303423487, ...}

M p = 2^{ p} − 1 |

p |

{3, 7, 31, 127, 8191, 131071, 524287, 2147483647, 2305843009213693951, 618970019642690137449562111, 162259276829213363391578010288127, 170141183460469231731687303715884105727, ...}

A117293 The Mersenne primes written in binary.

{11, 111, 11111, 1111111, 1111111111111, 11111111111111111, 1111111111111111111, 1111111111111111111111111111111, 1111111111111111111111111111111111111111111111111111111111111, ...}

p |

M p = 2^{ p} − 1 |

Mp |

{2, 3, 5, 7, 13, 17, 19, 31, 61, 89, 107, 127, 521, 607, 1279, 2203, 2281, 3217, 4253, 4423, 9689, 9941, 11213, 19937, 21701, 23209, 44497, 86243, 110503, 132049, 216091, 756839, 859433, 1257787, ...}

n |

{1, 1, 2, 3, 4, 6, 6, 10, 19, 27, 33, 39, 157, 183, 386, 664, 687, 969, 1281, 1332, 2917, 2993, 3376, 6002, 6533, 6987, 13395, 25962, 33265, 39751, 65050, 227832, 258716, 378632, 420921, 895932, ...}

2^{ ( p − 1)} |

2^{ p} − 1 |

{2, 4, 16, 64, 4096, 65536, 262144, 1073741824, 1152921504606846976, 309485009821345068724781056, 81129638414606681695789005144064, 85070591730234615865843651857942052864, ...}

A138837 Primes that are not Mersenne primes (A000668).

{2, 5, 11, 13, 17, 19, 23, 29, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, ...}

## See also

## Notes

## External links

- Great Internet Mersenne Prime Search (GIMPS)
- Pablo A. Panzone, On the generating functions of Mersenne and Fermat primes, SpringerLink, 2010.
- Pablo A. Panzone, On the generating functions of Mersenne and Fermat primes, Collectanea, 2010.