The most efficient method presently known for testing the primality of Mersenne numbers is the Lucas–Lehmer primality test. Specifically, it can be shown that for prime , is prime if and only if divides , where and for .
The most efficient method presently known for testing the primality of Mersenne numbers is the Lucas–Lehmer primality test Specifically it can be shown that for prime  is prime if and only if divides  where and for 