Hands first, words secondPress “Cross out multiples of …” again and again. After how many presses does the button say “Done”?
Loading figure…
Try this
Sieving with 2 crosses out a huge chunk. Then sieve with 3: among the numbers crossed out for the first time in this round, which is the smallest? What about sieving with 5 and with 7?
The smallest number crossed out for the first time is always p2. Why are the smaller multiples 2p, 3p, … already gone?
After sieving with 7, the button stops working. The next prime is 11, but 112=121 is already past 100.
Set N to 150 and sieve again. Which extra prime did you need this time? Why only that one?
An integer greater than 1 whose only positive divisors are 1 and itself is called a prime; otherwise it is called composite. 1 is neither.
Predict first
To decide whether 223 is prime by dividing by primes, what is the largest prime you need to try?
Choose an answer first; then you can see the result.
✓You predicted it!✗Not what you expected — which is exactly why it is worth a pause.
152=225>223, so 223<15. The primes up to 14 are just the six primes 2,3,5,7,11,13.
None of the six divisions comes out exact, so 223 is prime. Going up to half (111) also works, of course, but it wastes dozens of divisions.
Why
“You only need to go up to n” rests on this small fact.
A composite n has a prime factor no bigger than √n
Step 1 / 5
Loading figure…
A composite splits into two numbers
Let n be composite. It has a divisor other than 1 and n, so n=ab with 1<a≤b.
n=a⋅b,1<a≤b
The smaller one is not too big
Now take a prime factor of a
See it in the sieve
After four rounds
Do the primes ever run out?
Can the sieve go on forever? Or is there some point after which there are no more primes?
Predict first
Multiply the first six primes and add 1: 2×3×5×7×11×13+1=30031. Is it prime?
Choose an answer first; then you can see the result.
✓You predicted it!✗Not what you expected — which is exactly why it is worth a pause.
30031=59×509, so it is composite. But look at 59 and 509: they are new primes, not among 2,3,5,7,11,13.
This is no coincidence. Let N=p1p2⋯pk+1. Dividing N by any pi leaves remainder 1, so no prime factor of N is among p1,…,pk.
In other words: every finite list of primes is incomplete. There are infinitely many primes. This is Euclid's proof, more than two thousand years old.
Practice
Exercise 1Basic
List all the primes between 40 and 60.
Hint · direction
Cross out the even numbers and those ending in 5 first.
Hint · method
60<8, so you only need to sieve with 2,3,5,7.
Hint · first step
The odd numbers left: 41,43,47,49,51,53,57,59. Of these, 49=72, 51=3×17 and 57=3×19.
Full solution
41,43,47,53,59.
Exercise 2Basic
How many of the four numbers 91, 97, 119, 127 are prime?
Hint · direction
All four are less than 144=122.
Hint · method
Try dividing each one by 2,3,5,7,11.
Hint · first step
Don't forget 7: 91÷7=13.
Full solution
91=7×13 and 119=7×17 are composite; 97 and 127 are not divisible by any of 2,3,5,7,11, so they are prime. That makes 2.
Exercise 3Advanced
p is a prime such that p+10 and p+14 are also prime. Find p.
Hint · direction
Try a few small primes first and see what always goes wrong.
Hint · method
Look at the remainders of the three numbers when divided by 3.
Hint · first step
p+10 leaves the same remainder as p+1 when divided by 3, and p+14 the same as p+2. One of p,p+1,p+2 must be divisible by 3.
Full solution
One of p, p+10, p+14 is a multiple of 3. It is also prime, so it must equal 3. The last two are bigger than 3, so p=3. Check: 13 and 17 are both prime.
Exercise 4Challenge
Find all positive integers n such that n2−8n+15 is prime.
Hint · direction
This expression factors.
Hint · method
A prime written as a product of two integers can only be 1×p or (−1)×(−p).
Hint · first step
n2−8n+15=(n−3)(n−5). Make one of the factors equal to ±1.
Full solution
If n−5=1, then n=6 and the value is 3. If n−3=−1, then n=2 and the value is (−1)×(−3)=3. If n−3=1 or n−5=−1, then n=4 and the value is −1, which is not prime. So n=2 or 6.
The wrong step: 1 is divisible only by 1 and itself, so 1 is prime.
What went wrong? Think first, then open
DiagnosisA prime must have exactly two different positive divisors, and 1 has only one. More importantly: if 1 counted as a prime, then 6=2×3=1×2×3=1×1×2×3, and factorization would no longer be unique.
✓
The right step: The positive integers fall into three groups: 1; the primes (greater than 1, with only the two positive divisors 1 and itself); and the composites. 1 is a group of its own.
“1 is neither prime nor composite”
Exhibit
Trying only 2, 3 and 5
✗
The wrong step: 91 is odd, its digit sum 10 is not divisible by 3, and it does not end in 0 or 5, so 91 is prime.
What went wrong? Think first, then open
Diagnosis91≈9.5, and the primes up to that are 2,3,5,7. The 7 was never tried, and 91=7×13.
✓
The right step: To decide whether n is prime, try every prime up to n.
“Go all the way up to the square root, and skip none”
Exhibit
Thinking “product of primes plus 1” is always prime
✗
The wrong step: 2×3×5×7×11×13+1=30031 is not divisible by the first six primes, so it is prime.
What went wrong? Think first, then open
Diagnosis30031=59×509. It is only guaranteed not to be divisible by 2,3,5,7,11,13. Nobody promised it is not divisible by a bigger prime.
✓
The right step: Euclid's argument only says that the prime factors of this number are not on the original list. That is already enough to show the list is incomplete.
“Claim only what your proof actually uses”
Primes and Composites ← → step · F full screen · Esc exit