What makes a number prime, how the sieve of Eratosthenes finds them all, why they thin out, and why primes are easy to multiply and hard to find again.
Step 1 of 6 · What a prime is
Step 1 of 6
What a prime is
A prime number is a whole number with exactly two divisors: and itself. is prime; is not, and is called composite. Every composite number is a product of primes, in just one way: the primes are the building blocks of the numbers.
In the Scene the numbers from to are laid out in a spiral on a tray of tiles. The primes are the raised gold tiles, the composites are low and dark, and is grey.
Step 2 of 6
The largest below a hundred
To check whether a number is prime, you need not try dividing it by every smaller number. It is enough to try the primes up to its square root: if , one of the factors is no bigger than .
Step 3 of 6
The sieve
Eratosthenes, in the third century BCE, found every prime up to a limit without testing any number on its own. The sieve of Eratosthenes circles and crosses out all its multiples, then circles the next number not crossed out, , and crosses out its multiples, and so on. Every number left uncrossed is prime.
Count up to is now fixed at . Sieve the spiral will run the sieve: each prime crosses out its multiples in a colour of its own, from its square on, and the slate counts how many each one crossed out.
Step 4 of 6
Thinning out
The slate behind the tray counts the primes up to the limit. The further you count, the rarer they get, because a big number has more small primes that might divide it. And still they never run out: Euclid proved there are infinitely many primes.
Step 5 of 6
An eighth
At the tray is too large to show numbers, but the pattern stands out: the primes gather along diagonals. Nobody knows how to predict exactly where the next prime will appear.
Step 6 of 6
One easy direction
Multiplying two primes is easy, even when they are very long. Going the other way, finding the two primes from their product, is hard: no fast way is known to do it for numbers hundreds of digits long. An operation that is easy to do and hard to undo is the basis of cryptography, and the powers mod from the last Lesson are another such operation.
Loading the interactive version…
Loading the interactive version…
Each step sets up the Scene for you, and a control marked “fixed” stays put for that step.
Practice · Choose
Which of these numbers are prime? Choose all of them.
Practice · Choose
Which of these numbers are prime? Choose all of them.
Practice · Calculate
Count up to is fixed at . What is the largest prime up to ?
Practice · Calculate
Count up to is fixed at . What is the largest prime up to ?
Practice · Predict, then look
Count up to is . The sieve of Eratosthenes circles a prime, crosses out its multiples, and moves on to the next prime. Through how many primes must it go before every tile left is prime? Choose, and then Sieve the spiral runs the sieve to the end.
Practice · Predict, then look
Count up to is . The sieve of Eratosthenes circles a prime, crosses out its multiples, and moves on to the next prime. Through how many primes must it go before every tile left is prime? Choose, and then Sieve the spiral runs the sieve to the end.
Practice · Reach the target
Up to there are primes. Change Count up to until the slate shows primes, then press Check.
Practice · Reach the target
Up to there are primes. Change Count up to until the slate shows primes, then press Check.
Practice · Calculate
Count up to is fixed at , and the slate shows how many primes there are up to there. What share of the numbers up to is prime? Answer in per cent.
Practice · Calculate
Count up to is fixed at , and the slate shows how many primes there are up to there. What share of the numbers up to is prime? Answer in per cent.
Practice · Choose
Multiplying is easy: . Now the other way round: someone gives you only . What is true of it?
Practice · Choose
Multiplying is easy: . Now the other way round: someone gives you only . What is true of it?
Lesson complete. Every practice question here is done.
