Skip to content

Latest commit

 

History

History
6 lines (5 loc) · 545 Bytes

README.md

File metadata and controls

6 lines (5 loc) · 545 Bytes

Lucas-Lehmer

An implementation of the Lucas-Lehmer primality test in go (with a few optimizations).

Optimizations

  • For all Mersenne primes (of the form 2p-1) p has to be a prime number, so before doing the more costly Lucas-lehmer test we make sure p is prime.
  • The modulus in the Lucas-Lehmer test is made a lot faster in the fastMod function which uses bitwise operators instead of division, moving the slowest part of the test to the multiplication of s*s.