
Lucas Lehmer Test
The Lucas-Lehmer Test is a method used to determine if a Mersenne number (a number of the form 2^p - 1, where p is prime) is itself prime. It involves a sequence starting from 4, where each new term is derived by squaring the previous term and then subtracting 2, with the process repeated p-2 times. If, after these iterations, the final result is divisible by the original Mersenne number, then the number is prime; if not, it's composite. This test is efficient for large numbers and is specialized for Mersenne primes.