Everyone needs a sieve of Eratosthenes.