Mersenne Number
Numbers one less than a power of two.
Live Calculator
MembersVariables
Example
M_7 = 127 (prime)
How it works
A Mersenne number is formed by taking a power of 2 and subtracting 1, so its size is always just below a "round" binary boundary. This is useful because powers of 2 are especially simple in binary: 2^p is written as 1 followed by p zeros, and subtracting 1 turns those zeros into ones. That is why M_p = 2^p - 1 produces numbers like 3, 7, 15, 31, and so on.
When to use it
Use this formula when working with special integers in number theory, especially when testing candidates for Mersenne primes or studying patterns in binary representation. It also appears in computer science and cryptography because powers of 2 and their neighbors have convenient bit patterns.
Worked example, step by step
Take p = 11 M_11 = 2^11 - 1 2^11 = 2048 2048 - 1 = 2047 So, M_11 = 2047
Common mistakes to avoid
- Forgetting that p is the exponent, not the value being doubled
- Subtracting 1 before calculating the power of 2
- Assuming every Mersenne number is prime
Did You Know?
The largest known primes are all Mersenne primes, one form 2^p−1 with over 24 million digits.
Share this formula
More in Number Theory
View allEuclidean Algorithm
BasicRecursively finds the greatest common divisor.
Modular Congruence
Basica and b have the same remainder when divided by m.
Fermat's Little Theorem
AdvancedHolds when p is prime and gcd(a,p)=1.
Euler's Totient
AdvancedCounts integers up to n coprime to n.
Prime Number Theorem
AdvancedApproximates the number of primes below x.
LCM from GCD
BasicLeast common multiple via the greatest common divisor.