News for hackers. Stuff that matters.
Re:Dijkstra's Prime Number Algorithm by nroets on Tuesday April 05, 2016 @08:28AM (#11429801)
You can solve much more problems from Project Euler using a DFS variation of the Sieve of Euler. It is a depth first search of all the numbers less than n. It visits every number exactly once. When it visits a number, the prime factorization of the number is available (or any quantity derived from the factorization, like Euler's phi function).

And it uses no divisions.

https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes#Euler.27...

There are no comments on this comment yet.