LucasLehmer
The Lucas–Lehmer test is a primality test for Mersenne numbers of the form M_p = 2^p − 1, where p is a prime. The test determines whether M_p is prime. If p is not prime, M_p is composite, so the test is only applicable when p is prime.
The test has historical roots in the work of Édouard Lucas in the 19th century and was
Computationally, the test requires repeated modular squaring and reduction, so its runtime is roughly proportional to
When the test yields success, it provides a primality certificate for M_p, confirming that M_p is prime.
The Lucas–Lehmer test remains a foundational algorithm in computational number theory, illustrating how specialized modular sequences