A famous and ancient algorithm for finding prime numbers is the Sieve of Eratosthenes.
The idea here is to keep an initial element of the list of integers, but strike off all of its
multiples as possible primes. The example does this, but is performed only as far as
needed for a specific calculation. The list primes, however, really is exactly the list of
all the prime numbers!