A Mersenne number has the form . For certain prime exponents , this number is itself prime, yielding the celebrated Mersenne primes. These primes grow rapidly, so testing them efficiently requires specialized algorithms. The Lucas-Lehmer test provides a remarkably simple criterion: for prime greater than two, define the sequence and computed modulo . If , then is prime.
รdouard Lucas developed this method in the nineteenth century, and Derrick Lehmer later refined it for computational use. The test has powered the search for record-breaking primes, notably by the distributed GIMPS project. Because the sequence involves repeated squaring modulo the candidate prime, its simplicity belies the depth behind its correctness, which relies on properties of cyclic groups and quadratic recurrences.
Enter a prime exponent . For practical reasons this calculator accepts moderate values of ; extremely large exponents may exceed the precision of JavaScriptโs BigInt
. The script initializes to and iterates times, squaring and subtracting two modulo . If the final result is zero, the candidate is prime; otherwise it is composite. This provides a quick way to explore the rarity of Mersenne primes.
The Lucas-Lehmer test is deterministic for prime and remarkably fast compared with general-purpose primality checks. Understanding and experimenting with this algorithm highlights the interplay between number theory and computer arithmetic. It also offers a gateway into the world of distributed prime-search efforts.
Discover how your sun sign pairs with another using this zodiac compatibility calculator. Learn about the elements and qualities that influence astrological relationships.
Measure the difference between required skills and your current abilities. Plan your professional development with a clear skills gap score.
Check your eligibility for Japan's Highly Skilled Professional visa using our comprehensive points calculator. Estimate points for education, experience, income, age, and more.