Lurker News

Comments (491) 209 threads

Show all comments

Showing thread 163 of 209

greenpizza131 reply#
I love the Sieve of Eratosthenes. Even if it's not the most optimal, I find it a very clever and beautiful way to find prime numbers up to a given point.
chillee#
So the typical sieve of Eratosthenes is O(N log log N). Perhaps surprisingly, you can actually write a sieve that's O(N).