Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The Sieve of Atkin is VERY fast at generating primes between 1 and n.

It asymptotically speeds up the process of generating prime numbers. It has time complexity O(n/(log log n))

https://www.baeldung.com/cs/prime-number-algorithms




Your link seems to say it has time complexity O(n)?


If you count everything carefully, it's O(n / log log n)

https://www.ams.org/journals/mcom/2004-73-246/S0025-5718-03-...

They are essentially the same in all conceivable practical cases in this Universe.

log log (atoms in universe) < 100


This seems to be a matter of the above source reporting a variation of the algorithm that is asymptotically slower than the algorithm given in the paper *and* uses asymptotically more memory. Thanks for posting the paper!




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: