News for hackers. Stuff that matters.
Re:Dijkstra's Prime Number Algorithm by cyphar on Tuesday April 05, 2016 @01:09PM (#11432209)
The coolest technique I know of for checking primes is a variant of the Lucas sequence method (which is what GIMPS uses to find Mersenne primes)[1]. Essentially, you generate terms in a sequence in a constant-memory fashion that doesn't require you to know the factors, using just a modulo in a generating function.

[1]: https://www.youtube.com/watch?v=lEvXcTYqtKU

There are no comments on this comment yet.