An extension of the topic of primes and divisibility. The Sieve of Eratosthenes (around 240 BC) is an algorithm for finding primes: we successively cross out the multiples of 2, 3, 5, 7…, and whatever remains are the primes. Euclid proved (around 300 BC) that there are infinitely many primes, even though they thin out among the successive numbers.

I'll give you a number — decide whether it is prime. Hint: it is enough to check divisors up to .
What just happened?
The Sieve of Eratosthenes writes out the numbers 2, 3, 4, …, N, and then crosses out the multiples of each prime found — first 2 (4, 6, 8…), then 3 (6, 9, 12…), then 5, 7… Whatever is left uncrossed are the primes. A simple, mechanical recipe devised around 240 BC by Eratosthenes of Cyrene.
Why is it enough to sieve up to ?
Every composite number has a prime divisor no greater than :
If both factors were greater than , their product would exceed — a contradiction. That is why every composite number is crossed out by some prime and there is no need to sieve further. This is the key to the algorithm’s efficiency.
There are infinitely many primes (Euclid, ~300 BC):
In the “Elements” (Book IX) Euclid proves this elegantly by contradiction. Suppose there are finitely many primes: . Consider the number:
The number is not divisible by any of the (a remainder of 1 always stays). So either is itself prime, or it has a prime divisor not on the list — in both cases there is a prime we did not include. A contradiction. The set of primes is therefore infinite: .
They thin out, but never end
Among the successive natural numbers the primes appear more and more rarely — their density steadily decreases (visible on the bar to the right). Even so, they are never exhausted: you can always find the next one.
Why this matters for your exam:
The primes are the “building blocks” of all natural numbers — every natural number has a unique factorization into primes (the fundamental theorem of arithmetic). The Sieve of Eratosthenes and Euclid’s proof are classic school topics, and the primes are the foundation of modern cryptography (e.g. the RSA system bases its security on the difficulty of factoring large numbers into primes).
Remember: the Sieve of Eratosthenes crosses out the multiples of the primes up to — because every composite number has a prime divisor . There are infinitely many primes (Euclid), although their density decreases.
We write out ; we take the smallest number not yet crossed out (it is prime) and cross out its multiples; we repeat.
It is enough to sieve up to — every composite number has a prime divisor .
Euclid: if there were only finitely many (), then the number is not divisible by any of them — a contradiction. There are infinitely many primes.
Notation: the upper bound, the sieving threshold, the primes.
Infinitely many — Euclid proved this around 300 BC.
You successively cross out the multiples of the primes found so far; whatever is left uncrossed are the primes.
Because every composite number n has a prime divisor ≤ √n.
Teaching? Embed this experiment on your site.
Free widget — paste it on your school site, blog or notes. It links to the full version.