Skip to content

CJEnright/Lucas-Lehmer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

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.

About

An optimized Lucas-Lehmer primality test

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages