Prime Number Tester & Explorer
Explore interactive step-by-step calculations and visual graphs for these numbers.
The fascinating world of numbers
Mersenne numbers have the form 2p - 1. A value is a Mersenne prime only when the result is prime (which implies p is prime).
Explore interactive step-by-step calculations and visual graphs for these numbers.
| # | n (number) | Detail |
|---|---|---|
| 1 | 3 | 22 - 1 = 3 (Prime) |
| 2 | 7 | 23 - 1 = 7 (Prime) |
| 3 | 15 | 24 - 1 = 15 (Composite) |
| 4 | 31 | 25 - 1 = 31 (Prime) |
| 5 | 63 | 26 - 1 = 63 (Composite) |
| 6 | 127 | 27 - 1 = 127 (Prime) |
| 7 | 255 | 28 - 1 = 255 (Composite) |
| 8 | 511 | 29 - 1 = 511 (Composite) |
| 9 | 1023 | 210 - 1 = 1023 (Composite) |
| 10 | 2047 | 211 - 1 = 2047 (Composite) |
| 11 | 4095 | 212 - 1 = 4095 (Composite) |
| 12 | 8191 | 213 - 1 = 8191 (Prime) |
| 13 | 16383 | 214 - 1 = 16383 (Composite) |
| 14 | 32767 | 215 - 1 = 32767 (Composite) |
| 15 | 65535 | 216 - 1 = 65535 (Composite) |
| 16 | 131071 | 217 - 1 = 131071 (Prime) |
| 17 | 262143 | 218 - 1 = 262143 (Composite) |
| 18 | 524287 | 219 - 1 = 524287 (Prime) |
A Mersenne number is an integer of the form Mₙ = 2ⁿ − 1. When a Mersenne number is prime, it is called a Mersenne prime:
3 (2²−1), 7 (2³−1), 31 (2⁵−1), 127 (2⁷−1), 2047 (2¹¹−1), 8191 (2¹³−1), …
Named after 17th-century French friar Marin Mersenne, who compiled a famous list of them in 1644, Mersenne primes hold the distinction of being the largest known prime numbers in human history.
If 2ⁿ − 1 is prime, then n must itself be prime!
However, the converse is not true: 2¹¹ − 1 = 2047 = 23 × 89 (composite even though 11 is prime).
Even Perfect Number = 2ᵖ⁻¹ × (2ᵖ − 1)
Every even perfect number (equal to the sum of its proper divisors) corresponds 1:1 to a Mersenne prime! For example: 2¹ × (2² − 1) = 6, 2² × (2³ − 1) = 28, 2⁴ × (2⁵ − 1) = 496, 2⁶ × (2⁷ − 1) = 8,128.
A global distributed computing project that has discovered every world-record largest known prime number since 1996 using idle CPU cycles of millions of volunteers.
A deterministic, exceptionally fast algorithm specifically for Mersenne numbers: s₀ = 4, sᵢ = (sᵢ₋₁² − 2) mod Mₚ. Mₚ is prime if and only if s_{p-2} ≡ 0 (mod Mₚ).
In binary (base 2), any Mersenne number 2ⁿ − 1 consists of exactly n consecutive ones (e.g., 7 = 111₂, 31 = 11111₂, 127 = 1111111₂).
Because the Lucas-Lehmer test operates dramatically faster than general-purpose primality tests (like AKS or Miller-Rabin), allowing numbers with tens of millions of digits to be verified.
The Lenstra-Pomerance-Wagstaff conjecture predicts there are infinitely many Mersenne primes, but it remains one of the great unproven conjectures of number theory.