Day 124 · May 3

The Sieve of Eratosthenes — Filtering the Building Blocks of Arithmetic

Prime numbers hide inside the number system like scattered stars. 2. 3. 4. 5. 6. 7. At first they appear random. No obvious pattern controls where the next prime will emerge. The gaps stretch and shrink unpredictably. For thousands of years, primes fascinated mathematicians precisely because they seemed both orderly and chaotic at the same time. More than two thousand years ago, a Greek scholar named Eratosthenes discovered an astonishingly elegant method to uncover them. Not through complicated formulas. Through elimination. Imagine writing all numbers in order. Then begin crossing things out. Every multiple of 2 disappears. Then every multiple of 3. Then every multiple of 5. Slowly, the composite numbers vanish like noise fading from a signal. What remains are the primes. The method became known as the Sieve of Eratosthenes. The brilliance of the sieve lies partly in its simplicity. Even children can understand the process. Yet hidden inside it is a profound computational idea: difficult problems can sometimes be solved efficiently through systematic filtering. Long before computers existed, Eratosthenes had already invented an algorithmic way of thinking. Modern computing still relies on similar ideas constantly. Search engines filter information. Spam detectors eliminate unwanted patterns. Artificial intelligence models classify data through repeated selection and removal. Again and again, complexity becomes manageable through elimination. The sieve also reveals something strangely beautiful about mathematics. Prime numbers are not generated directly. They emerge naturally once everything else is removed. Sometimes truth appears not because we create it, but because we patiently strip away what does not belong. And beneath modern cryptography, internet security, and computational number theory, the ancient sieve still whispers quietly across time.

How quickly can we check if a number is prime using the sieve? We only need to cross out multiples of numbers up to the square root of the limit.

Practice related topics on DuelMath

Challenge someone →