Over two thousand years ago, the Greek scholar Eratosthenes found a simple way to list prime numbers: write down the numbers, then cross out the multiples of each prime in turn, and whatever is never crossed out is prime. Step through his sieve on the numbers up to 100 or 200, find out why it can stop early, and see how much less work it does than testing every number on its own.

This article and its interactive demo were created with the help of generative AI and editorially reviewed.