Sieve of Eratosthenes.