← All projects / The Gap of 3

The gap of 3

Read a binary string with places worth 3, 6, 9, 12, and so on, and every value is a multiple of 3: they come in steps of 3, and 10 never appears. Many strings share each value. Gather them into groups and every group has the same few slots, filled by the power of 2, the Fermat numbers, the 67s and the 97s.

Open a group

Pick a value. The top spellings are listed biggest first, with their slot, then every spelling in the group with the primes marked.

primepower of 22ⁿ + 1, Fermat2ⁿ + 3, the 67s3·2ⁿ + 1, the 97s

The slots

Top: a power of 2

The biggest spelling of every group uses a single place, so it's always a power of 2: 4, 8, 16, 32 and so on. Every group has exactly one.

Second: a power of 2 plus 1

The next one down uses the next place and the 3's place, so it's a power of 2 plus 1. When that's prime it's a Fermat prime, and all five known Fermat primes sit here.

The next odd one: the 67s

The biggest odd spelling after that is a power of 2 plus 3, the 67s family. For n from 2 on, 2n + 3 always sits in value 3(n + 4). Below, every n up to 64 where it's prime.

The 97s have a slot too

3 · 2n + 1 uses the 3's place and two neighbouring places at the top, so it always sits in value 6(n + 2). 97 is the only prime in value 42. Every n up to 64 where it's prime:

Every group up to 120

A prime other than 2 has to use the 3's place, or it's even, and it can't be a multiple of 3. So within each group only some spellings are candidates. The chart shows the share of candidates that are prime. The grey bars are values that are multiples of 9, and they mostly come up short: that's the lean from 7, below.

other valuesmultiples of 9

Move along the chart.

Only two values have no prime spelling at all: 15 and 27 (and 3, whose only spelling is 1). Value 9 shows a prime with no candidates because its prime is 3 itself.

With 13 in place of 12

Swap one place: 3, 6, 9, 13, 15, 18, 21, and so on. Everything that uses the 8's place gains 1, so values are no longer all multiples of 3, but 10 still never appears: the only places small enough to reach it are 3, 6 and 9. Here's what the swap does to the leans, for every prime from 8,192 to 226. Bars are the primes' distance from an even share, dots the prediction from skipping one number's multiples.

primesprediction

The 7 lean spreads out

By 9, the lean from 7 is still there and still predicted almost exactly by skipping the multiples of 7. But the 13 splits each remainder in two (0 and 1, 3 and 4, 6 and 7), so the biggest gap halves, from 2.6 to 1.4 points.

A lean from 5 grows

Whether the value is odd or even leans too, and that one comes from 5. With 3, 6, 9, 12 it's faint, 0.32 points, mostly predicted by skipping multiples of 5. With 13 in place it nearly doubles to 0.60 points and flips direction, and skipping multiples of 5 predicts it exactly.

Why 5

5 is 22 + 1, a Fermat prime. With 3, 6, 9, 12, times anything below 4 it writes that number twice, two places apart, and places two apart are both odd or both even multiples of 3, so the total is always even. The Mersenne prime 7 does the same thing by 9. Why the 13 makes this lean flip and look bigger is the next section.

Where to go next

Other place systems could be tested the same way: pick the place values, look for leans in the primes, then look for the one number whose multiples cause each lean. See The Death of Zero for the Mersenne leans in full.

The lean is an echo

Powers of 2 repeat their remainders by 5 every four places: 1, 2, 4, 3, then 1, 2, 4, 3 again. Call that 5's echo, with length 4. For 7 it's 1, 2, 4, length 3. The place values have a rhythm too: odd, even, odd, even. A lean appears when the two rhythms fit together, and everything about it follows from the echo. All the numbers in this section come from an exact formula, worked out in your browser, that matches the counted primes above to two decimals.

Move the extra 1 to another place

The 13 is the 8's place with 1 added. Add the 1 to a different even-valued place instead (6, 18, 24 and so on) and look at the multiples of 5 below 226. The effect swings back and forth, repeating every four places, which is 5's echo length.

Move along the chart.

Why it flips: a quarter turn

The lean behaves like an arrow. Only its left to right part shows up as odd against even. The rest points up or down, where an odd and even count can't see it. With 3, 6, 9, 12 the arrow points mostly down, so only a sliver shows. Putting 13 in turns the arrow a quarter turn, one step of the four-step echo, and shrinks it to 73% of its length. Most of it now shows, on the other side. So the lean didn't grow. It was already there, turned out of sight. In the picture each arrow is the whole lean, and the thick bar on the line is the part of it that shows.

The echo fades

Each time the echo goes round, the lean shrinks by a fixed factor: 0.59 every four places for 5, and 0.85 every three places for 7. So these are leans of small numbers. By about 150 bits they're gone, and a prime with millions of bits shows none of this.

7: share on 0 by 9, above an even third5 with 12: even share, above half5 with 13: even share, below half

Move along the chart.

The golden ratio is in it

5's fade factor is exactly φ3 × √5 ÷ 16 = 0.592, where φ is the golden ratio 1.618. The shrink from the quarter turn, 0.727, is the tangent of 36 degrees, the angle of a five-pointed star. Both come from the regular pentagon, because 5 is doing the work.

Swap every fourth place and it cancels

If every fourth place gets the extra 1, not just the 8's place, the turns add up to nothing: the even share goes back to 49.8% at 26 bits and to exactly half further out. One broken place is what makes the echo visible.

What this changes

The leans in the primes are real and predicted exactly, but they're not a law of big primes. They come from the small multiples of 5, 7, 31 and 127 lining up, and the line-up loosens as numbers get longer.

How it's worked out

Each place multiplies a running total by a fixed number that depends on where it sits in the echo. The product over all the places gives the count directly, with no need to list the numbers. At 26 bits it gives 51.08% and 47.59% for 5, and 47.93% for 7, the same as counting.