Mersenne Number Calculator

Generate and test a Mersenne number.

How to use

  1. Enter your values in the fields above.
  2. Press Calculate to see your result instantly.
  3. Use the Share button to copy a link to your result.

About this calculator

A Mersenne number has the form 2^p − 1 for a positive integer p, named after 17th-century friar and mathematician Marin Mersenne, who studied which of these numbers are prime. A Mersenne number can only be prime if the exponent p itself is prime, though that condition isn't sufficient on its own — 2^11 − 1 = 2047 = 23 × 89 is a counterexample despite 11 being prime. When a Mersenne number is prime, it's called a Mersenne prime, and it can be tested efficiently with the Lucas-Lehmer primality test, which is far faster than general-purpose primality testing for numbers of this size.

Mersenne primes are famous partly because they're the largest known primes ever discovered — the distributed computing project GIMPS (Great Internet Mersenne Prime Search) has found every record-holding prime since the 1990s by having volunteers' computers test candidate exponents around the clock. Beyond the hunt for record primes, Mersenne numbers show up in computer science because 2^p − 1 in binary is a run of p consecutive 1 bits, which makes them natural bit-masks, and each Mersenne prime corresponds to a perfect number via Euclid's formula.

This calculator computes 2^p − 1 for the exponent you enter and checks whether the result is prime.

Was this helpful?

Comments (0)

  • Be the first to comment.

Popular calculators

All Calculators