← All projects / The Gaps Between Primes
Ten is 2 × 5, so if primes are a "2 and 5 thing" it ought to show in the gaps between them when those gaps are written in base 2 and base 5. Here are all the gaps up to ten million. The 2 and the 5 are both there. So are 3, 7, 11 and 13, each leaving exactly the same kind of mark.
The oldest way to find primes is to cross out the multiples of 2, then of 3, then of 5, and so on. The numbers you cross out with are the primes themselves. Nothing else is needed and nothing else works.
Cross out the multiples of 2. The first number left standing is 3, so 3 is prime, and now you cross out with 3. The first number left after that is 5, so you cross out with 5. Each prime you find becomes the tool for finding the next. To get the primes you already need the primes.
Every pattern on this site that narrows down the primes is a piece of that loop: the 6n ± 1 wheel is the 2 and the 3, the 60-hour clock is five more small primes, a bigger wheel is a few more again. None of them steps outside the loop, which is why none of them ever finishes the job.
| Prime | Next prime | Gap | Gap in base 2 | Gap in base 5 |
|---|
| The gap ends in | Share of all gaps | If it were a coin toss |
|---|
Past 2, every prime is odd, so the gap between two of them is even. In base 2 an even number ends in 0. That is the whole of what the 2 does: it forces one zero on the end.
| Last base 5 digit of the gap | Share of all gaps | The smallest gaps of that kind |
|---|
Here are the commonest gaps. The bars are uneven, but the unevenness has a rule: a gap that is a multiple of 3 turns up twice as often as its neighbours, a multiple of 5 one and a third times as often, a multiple of 7 one and a fifth. Divide each count by its boost and what is left falls away smoothly.
multiple of 3multiple of 5 but not 3neither
| Gap | Base 2 | Base 5 | How many | Boost | Count ÷ boost |
|---|
For a prime p the boost is p − 1 divided by p − 2. So 3 gives 2, 5 gives 4/3, 7 gives 6/5, 11 gives 10/9. It comes from the loop: a gap that is a multiple of p can never push the next number onto a multiple of p, so p never gets to veto it.
The 2 makes every gap even. The 5 makes gaps that are multiples of 5 a third more common than they'd otherwise be. But 3 does the same thing more strongly, and 7, 11 and 13 do it more weakly. 2 and 5 only look special because they are the two primes ten is made of.
That is true and it has a plain cause. Every 1010 number is even, so 2 is the only one that can be prime. Every 0101 number past 5 splits into two smaller factors, which is proved. That the two survivors are 2 and 5 is a neat accident: in binary they are 10 and 101, the two shortest numbers of each pattern.