Lucas-Lehmer Test
The Lucas-Lehmer Test is a mathematical algorithm used to determine if a number of the form 2^p - 1 is prime, where p is a prime number. This test is specifically designed for Mersenne primes, which are named after the French monk Marin Mersenne.
To perform the test, start with the number 4 and repeatedly square it, subtracting 2 each time, for p - 2 iterations. If the final result is 0, then 2^p - 1 is prime; otherwise, it is composite. This method is efficient for large values of p.