A Mersenne number is a number of the form
(1)
|
where is an integer. The Mersenne numbers consist of all 1s in base-2, and are therefore binary repunits. The first few Mersenne numbers are 1, 3, 7, 15, 31, 63, 127, 255, ... (OEIS A000225), corresponding to , , , , ... in binary.
The Mersenne numbers are also the numbers obtained by setting in a Fermat polynomial. They also correspond to Cunningham numbers .
The number of digits in the Mersenne number is
(2)
|
where is the floor function, which, for large , gives
(3)
|
The number of digits in is the same as the number of digits in , namely 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, ... (OEIS A034887). The numbers of decimal digits in for , 1, ... are given by 1, 4, 31, 302, 3011, 30103, 301030, 3010300, 30103000, 301029996, ... (OEIS A114475), which correspond to the decimal expansion of (OEIS A007524).
The numbers of prime factors of for , 2, ... are 0, 1, 1, 2, 1, 3, 1, 3, 2, 3, 2, 5, 1, 3, 3, 4, 1, 6, ... (OEIS A046051), and the first few factorizations are
(4)
| |||
(5)
| |||
(6)
| |||
(7)
| |||
(8)
| |||
(9)
| |||
(10)
| |||
(11)
| |||
(12)
| |||
(13)
|
(OEIS A001265). The indices of Mersenne numbers that give semiprimes are 4, 9, 11, 23, 37, 41, 49, 59, 67, 83, ... (OEIS A085724). As of 2022, the largest known indices giving semiprimes are 1427 and 1487.
The smallest primes dividing are therefore 1, 3, 7, 3, 31, 3, 127, 3, 7, 3, 23, 3, 8191, ... (OEIS A049479), and the largest are 1, 3, 7, 5, 31, 7, 127, 17, 73, 31, 89, 13, 8191, ... (OEIS A005420).
In order for the Mersenne number to be prime, must be prime. This is true since for composite with factors and , . Therefore, can be written as , which is a binomial number and can be factored. Since the most interest in Mersenne numbers arises from attempts to factor them, many authors prefer to define a Mersenne number as a number of the above form
(14)
|
but with restricted to prime values.
All known Mersenne numbers with prime are squarefree. However, Guy (1994) believes that there are which are not squarefree.
The search for Mersenne primes is one of the most computationally intensive and actively pursued areas of advanced and distributed computing. Edgington maintains a list of known factorizations of for prime .