Lucas-Lehmer Test


Definition. Let
S1 = 4
and
Sn+1 = Sn2 - 2 for n >= 1.



Lucas-Lehmer Test. Let p be a prime number. Then,

Mp = 2p-1 is prime

if and only if

Mp divides Sp-1 .