Sieve of Eratosthenes

Use an ancient algorithm to discover prime numbers

The Sieve of Eratosthenes is a simple algorithm that can be used to find prime numbers. A detailed explanation (and a nice animation of its use) can be found on Wikipedia. It’s an excellent exercise for students because it helps them recognize the characteristics of prime numbers and illustrates the use of an algorithm to find them.