Mersenne Number Calculator
Generate and test a Mersenne number.
Result
How to use
- Enter your values in the fields above.
- Press Calculate to see your result instantly.
- 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?
Popular calculators
Loan Calculator
Monthly payment, total interest and full amortization schedule.
Percentage Calculator
Percent change, percent of, and ratio calculations.
Discount Calculator
Calculate final price, savings, and discount amount.
BMI Calculator
Body mass index from height and weight (metric or imperial).
Age Calculator
Compute your exact age in years, months and days from a birth date.
Compound Interest Calculator
Calculate the final amount and interest earned with compounding.
All Calculators
No calculators found
Comments (0)