Hacker News new | past | comments | ask | show | jobs | submit
My approach to the first 100 Euler eventually involved a bitmap of possible primes (only odd numbers, there's only one even prime) which was initially seeded by a 'magic number' set representing the lowest primes and would grow up to a target number of cached small / really fast primes.

Then the algorithms I understand less kick in. Most of those involve some form of modo math to wrap the number space based on one or more origami like folds and use well known and test algorithms which were previously exhaustively proven to cover the entire 32 bit number-space when utilized in a composite fashion.