Mersenne Number Calculator

Enter a number to check if it's a Mersenne number, or specify a range to generate all Mersenne numbers.

Mersenne Number Check or Generate

What is a Mersenne Number?

A Mersenne number, also known as a Mersenne prime (in some cases), is a number of the form \(M_n = 2^n - 1\), where \(n\) is a positive integer. Named after the French mathematician Marin Mersenne, these numbers play an important role in number theory and cryptography.

How to Determine if a Number is a Mersenne Number

Formula Check

A number \(x\) is a Mersenne number if there exists a positive integer \(n\) such that \(x = 2^n - 1\).

Steps to Verify

  1. For a given number \(x\), add 1 to it, resulting in \(x + 1\).
  2. Check if \(x + 1\) is a power of 2, i.e., if it can be expressed as \(2^n\).

Examples

Example 1: Is 31 a Mersenne Number?

Solution:

31 + 1 = 32

32 = \(2^5\) (Yes, 32 is a power of 2)

Result: 31 is a Mersenne number.

Example 2: Is 255 a Mersenne Number?

Solution:

255 + 1 = 256

\(256 = 2^8\) (Yes, 256 is a power of 2)

Result: 255 is a Mersenne number.

Example 3: Is 10 a Mersenne Number?

Solution:

10 + 1 = 11

11 is not a power of 2 (\(2^3 = 8\), \(2^4 = 16\))

Result: 10 is not a Mersenne number.