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

Elsewhere someone already mentioned the Ulam Spiral [1] and I'll add the Sieve of Pritchard [2] which combines the Sieve of Eratosthenes with Wheel Factorization. Its wiki page has a nice visualization. Notice that when the primes are arranged in a rectangular grid (rows at a time, left-to-right, top-to-bottom) there are entire columns that can immediately be eliminated from consideration.

[1]: https://wikipedia.org/wiki/Ulam_spiral

[2]: https://wikipedia.org/wiki/Sieve_of_Pritchard



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

Search: