pyLucasLehmer Lucas Lehmer test for Mersenne prime numbers in Python Wikipedia page explaining Lucas-Lehmer algorythm. Wikipedia also has a very good page on Merssene prime numbers.