ArticleslgStudy

mathematics

Mersenne prime

Mersenne prime is a mathematics topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Mersenne prime rather than just read about it. In short: In mathematics, a Mersenne prime is a prime number that is one less than a power of two. That is, it is a prime number of the form Mn = 2n − 1 for some integer n.

Mersenne prime — main illustration
Mersenne prime — illustration

Key takeaways

  • Mersenne prime belongs to mathematics; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Mersenne prime to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Mersenne prime from memory before moving on to harder problems.

Reference excerpt

In mathematics, a Mersenne prime is a prime number that is one less than a power of two. That is, it is a prime number of the form Mn = 2n − 1 for some integer n. They are named after Marin Mersenne, a French Minim friar, who studied them in the early 17th century. If n is a composite number then so is 2n − 1. Therefore, an equivalent definition of the Mersenne primes is that they are the prime numbers of the form Mp = 2p − 1 for some prime p. The exponents n that give Mersenne primes are 2, 3, 5, 7, 13, 17, 19, 31, ... (sequence A000043 in the OEIS) and the resulting Mersenne primes are 3, 7, 31, 127, 8191, 131071, 524287, 2147483647, ... (sequence A000668 in the OEIS). Numbers of the form Mn = 2n − 1 without the primality requirement may be called Mersenne numbers. Sometimes, however, Mersenne numbers are defined to have the additional requirement that n should be prime. The smallest composite Mersenne number with prime exponent n is 211 − 1 = 2047 = 23 × 89. Mersenne primes were studied in antiquity because of their close connection to perfect numbers: the Euclid–Euler theorem asserts a one-to-one correspondence between even perfect numbers and Mersenne primes. Many of the largest known primes are Mersenne primes because Mersenne numbers are easier to check for primality. As of 2025, 52 Mersenne primes are known. The largest known prime number, 2136279841 − 1, is a Mersenne prime. Since 1997, all newly found Mersenne primes have been discovered by the Great Internet Mersenne Prime Search, a distributed computing project. In December 2020, a major milestone in the project was passed after all exponents below 100 million were checked at least once.

About Mersenne primes A basic theorem about Mersenne numbers states that if Mp is prime, then the exponent p must also be prime. This follows from the identity

2ab−1=(2a−1)⋅(1+2a+22a+23a+⋯+2(b−1)a)=(2b−1)⋅(1+2b+22b+23b+⋯+2(a−1)b). This rules out primality for Mersenne numbers with a composite exponent, such as M4 = 24 − 1 = 15 = 3 × 5 = (22 − 1) × (1 + 22). Though the above examples might suggest that Mp is prime for all primes p, this is not the case, and the smallest counterexample is the Mersenne number

M11 = 211 − 1 = 2047 = 23 × 89.

Many fundamental questions about Mersenne primes remain unresolved. It is not even known whether the set of Mersenne primes is finite or infinite. The Lenstra–Pomerance–Wagstaff conjecture claims that there are infinitely many Mersenne primes and predicts their order of growth and frequency: For every number n, there should on average be about eγ⋅log2(10)≈5.92 primes p with n decimal digits for which Mp is prime. Here, γ is the Euler–Mascheroni constant. It is also not known whether infinitely many Mersenne numbers with prime exponents are composite, although this would follow from widely believed conjectures about prime numbers; for example, from the infinitude of Sophie Germain primes congruent to 3 (mod 4). For these primes p, 2p + 1 (which is also prime) will divide Mp, for example, 23 | M11, 47 | M23, 167 | M83, 263 | M131, 359 | M179, 383 | M191, 479 | M239, and 503 | M251 (sequence A002515 in the OEIS). For these primes p, 2p + 1 is congruent to 7 mod 8, so 2 is a quadratic residue mod 2p + 1, and the multiplicative order of 2 mod 2p + 1 must divide (2p+1)−12=p. Since p is a prime, it must be p or 1. However, it cannot be 1 since Φ1(2) = 1 and 1 has no prime factors, so it must be p. Hence, 2p + 1 divides Φp(2) = 2p − 1 and 2p − 1 = Mp cannot be prime. The first four Mersenne primes are M2 = 3, M3 = 7, M5 = 31 and M7 = 127 and because the first Mersenne prime starts at M2, all Mersenne primes are congruent to 3 (mod 4). Other than M0 = 0 and M1 = 1, all other Mersenne numbers are also congruent to 3 (mod 4). Consequently, in the prime factorization of a Mersenne number ( ≥ M2) there must be at least one prime factor congruent to 3 (mod 4). The evidence at hand suggests that a randomly selected Mersenne number is much more likely to be prime than an arbitrary randomly selected odd integer of similar size. Nonetheless, prime values of Mp appear to grow increasingly sparse as p increases. For example, eight of the first 11 primes p give rise to a Mersenne prime Mp (the correct terms on Mersenne's original list), while Mp is prime for only 43 of the first two million prime numbers (up to 32452843). Since Mersenne numbers grow very rapidly, the search for Mersenne primes is a difficult task, even though there is a simple efficient test to determine whether a given Mersenne number is prime: the Lucas–Lehmer primality test (LLT), which makes it much easier to test the primality of Mersenne numbers than that of most other numbers of the same size. The search for the largest known prime has somewhat of a cult following. Consequently, a large amount of computer power has been expended searching for new Mersenne primes, much of which is now done using distributed computing. Arithmetic modulo a Mersenne number is particularly efficient on a binary computer, making them popular choices when a prime modulus is desired, such as the Park–Miller random number generator. To find a primitive polynomial of Mersenne number order requires knowing the factorization of that number, so Mersenne primes allow one to find primitive polynomials of very high order. Such primitive trinomials are used in pseudorandom number generators with very large periods such as the Mersenne twister, generalized shift register and Lagged Fibonacci generators.

Perfect numbers

Mersenne primes Mp are closely connected to perfect numbers. In the 4th century BC, Euclid proved that if 2p − 1 is prime, then 2p − 1(2p − 1) is a perfect number. In the 18th century, Leonhard Euler proved that, conversely, all even perfect numbers have this form. This is known as the Euclid–Euler theorem. It is unknown whether there are any odd perfect numbers.

History

Mersenne primes take their name from the 17th-century French scholar Marin Mersenne, who compiled what was supposed to be a list of Mersenne primes with exponents up to 257. The exponents listed by Mersenne in 1644 were as follows:

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Mersenne prime

Start with the simplest possible case. Write down what Mersenne prime claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In mathematics, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Mersenne prime before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Mersenne prime ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Mersenne prime

In research
Mersenne prime appears in mathematics research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Mersenne prime in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Mersenne prime is common in secondary-school and first-year university syllabi. It links to neighbouring topics Classes of prime numbers, Integer sequences, Mersenne primes, so understanding it makes those chapters shorter.
In everyday life
Look for Mersenne prime outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Mersenne prime” →

How to study Mersenne prime in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Mersenne prime means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Mersenne prime out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Mersenne prime in simple terms?

In mathematics, a Mersenne prime is a prime number that is one less than a power of two. That is, it is a prime number of the form Mn = 2n − 1 for some integer n.

Why does Mersenne prime matter?

Because it connects several mathematics ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Mersenne prime?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Mersenne prime.

Tags

  • Classes of prime numbers
  • Integer sequences
  • Mersenne primes
  • Perfect numbers
  • Unsolved problems in number theory

Keep exploring