This site is supported by donations to The OEIS Foundation.

Mersenne numbers

From OeisWiki
Jump to: navigation, search


This article page is a stub, please help by expanding it.


Mersenne numbers are numbers of the form 
2n  −  1
, where 
n
is a nonnegative integer. They are repunits in binary. These numbers are named after Marin Mersenne, who studied them, though the term usually refers to numbers of the form 
2p  −  1
, where 
p
is prime.
A000225
2n  −  1
. (Sometimes called Mersenne numbers, although that name is usually reserved for A001348.)
{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, ...}
A001348 Mersenne numbers: 
2p  −  1
, where 
p
is prime.
{3, 7, 31, 127, 2047, 8191, 131071, 524287, 8388607, 536870911, 2147483647, 137438953471, 2199023255551, 8796093022207, 140737488355327, 9007199254740991, 576460752303423487, ...}

The Mersenne primes are a subsequence of A001348, which is itself a subsequence of A000225.

A necessary, but not sufficient, condition for a Mersenne number (repunit base 2) to be prime is to have a prime number of 1s, otherwise you can interpret the repunit as if it is in base 1 (tally marks), factorize it, then reinterpret the base 1 (tally marks) factors in base 2!

Generating functions

The ordinary generating function of base 2 repunits is

The exponential generating function of base 2 repunits is