← All projects / Seven Rabbit Holes

Hunting for a rule, seven ways

Seven different attempts to find an equation or rule that says where primes turn up in a family. Each rule was built on one set of numbers and then tested on numbers it had never seen, because a rule that only fits the data it came from isn't a rule.

The short version

Rabbit holeWhat came outDoes it hold on fresh data?
1. One equation for how many primesAbout 8.3 primes each time the power grows tenfold, for both the 67s and 97sYes for the count. It says nothing about which rows.
2. Which cousin family is richestA formula using only small primes ranks 1,000 families by how many primes they holdYes, about as well as any forecast could.
3. A learning machine on the digits of bases 2 to 16It rediscovers "does it divide by a small prime" and nothing elseIt ties with the plain sieve, and is pure guesswork beyond it.
4. Guessing the next prime from this one's endingsKnowing the last digit in several bases at once names the exact next prime about a quarter of the timeYes, but the edge shrinks as primes get bigger.
5. A family that picks its own bitsA prime every 10 rows or so, for as long as you like, with a formula for how oftenYes. It works by searching, not by predicting.
6. What the 67s and 97s shareThey are each other read backwards, and the 97s' clock is the 67s' clock run in reverseExact. It explains why they're twins, not where their primes are.
7. The families whose gaps don't come out roundThe awkward gaps (3.33, 0.67, 0.13) are exact thirds, set by the length of the block. Most families have themThe fractions are exact. Those families land on primes exactly as often as the round ones.

Where that leaves the hunt. Four things about primes in these families can be predicted reliably: where a prime can never be, how many to expect in any stretch, which family will be richer, and how to build a family that keeps landing on primes. One thing can't, by any method tried here: which particular row is next. Every hole ran into that same wall from a different side.

1. One equation for how many primes

The 60-hour clock says which powers can never give a prime. Taking it further, with every prime under 100,000 instead of five, gives a forecast for any stretch of powers. It boils down to one line.

I built it on my own search, which stops at a power of 20,000. Then I checked it against the published lists, which run more than a hundred times further for the 67s and eight hundred times further for the 97s.

Powers fromto67s expected67s found97s expected97s found

2. Which cousin family is richest

The 67s are a power of two plus 3. Swap the 3 for any other odd number and you get a cousin. Is there a formula that says which cousins will be rich in primes, without testing a single number for primality?

There is. For each cousin, work out which powers the small primes kill, and add up the odds on the powers left standing. I did that for all 1,000 cousins from plus 1 to plus 1,999 using only the primes under 20,000. Then I searched every cousin properly, up to a power of 2,000, and compared.

Cousins, ranked by forecastForecastFound

measured

The forecast is about as good as a forecast can be

exact

The rule for a rich family

Add a number that is itself a multiple of lots of small primes. A power of two never divides by 3, so "a power of two plus a multiple of 3" never divides by 3 either. The same goes for 5, 7 and 11. Every prime you build into the added number is a prime that can never spoil the family.

measured

The 67s are middling

This is the nearest thing to an equation for primes in this whole project: a formula made from small primes alone that correctly sorts a thousand families from richest to poorest. It still doesn't say which powers hold the primes, only how many there'll be.

3. A learning machine on the digits of bases 2 to 16

If there were a hidden rule in the digits, across the bases above and below ten, a learning program should be able to find it. I gave one 90 facts about each number: for every base from 2 to 16, its last digit, second-last digit, digit sum, the digit sum's remainder, the alternating digit sum's remainder and how many 1s it has. It trained on 300,000 odd numbers between 1 and 2 million and was tested on 150,000 between 5 and 6 million.

MethodScoreWhat it means

The score runs from 0.5, which is guessing, to 1, which is always right. The plain sieve says "not prime" if the number divides by a small prime, and gives every other number the same odds.

The machine tied with the plain sieve to three decimal places. Those 90 digit facts hold exactly the same information as "does it divide by 2, 3, 5, 7, 11, 13 or 17", and it found all of that and no more. Among the numbers the sieve can't rule out, it scored 0.49: a coin flip. Digits in other bases are a way of writing down small-prime divisibility, and nothing else about primes lives in them.

4. Guessing the next prime from this one's endings

Primes avoid repeating their last digit. How far can that be pushed? For every prime up to 100 million I took its ending in one base, or several bases at once, and used it to guess the exact next prime. The guesses were learned on the first half of each size band and scored on the second half.

Primes betweenTypical gapBlind guessFrom the base 10 endingFrom the endings in bases 2, 3 and 5Adding base 7Adding base 11

Each figure is how often the single best guess names the next prime exactly. The blind guess is "add the commonest gap". Knowing the endings in bases 2, 3 and 5 together is the same as knowing the remainder by 30. In the smallest band there are too few primes to learn the five-base recipe properly, which is why its last figure dips.

This one is real and it stacks: each extra base sharpens the guess. With five bases the best guess is right about twice as often as a blind one. But it fades. The same recipe is right 34% of the time for six-digit primes and 26% for eight-digit ones, and the trend carries on down. It narrows the next prime to a shortlist. It never names it.

5. A family that picks its own bits

Every family so far sends a fixed pattern of bits and takes whatever primes happen to turn up: a few dozen in 20,000 rows. This one is built the other way round. Start at 1. To get the next number, add bits on the right, as few as possible, so that the result is prime. Every stop is a prime.

RowsPrimes in this familyFormula saysPrimes in the 67s by then

measured

The spacing follows a formula

exact

It never has to stop

There is always a prime within reach. Add enough bits and the stretch of numbers you can land on is certain to contain a prime. That follows from a proved theorem about how slowly primes thin out. So this family can be carried on for ever, which no fixed family has been proved to do.

exact

Already known

The start of this family, 3, 7, 29, 59, 239, 479, 3,833, is in the sequence database as A261270, added in 2015. So it isn't new. It is the clearest example here of a "dynamic rule": a family that reacts to what it finds.

It gives a prime line that goes on for ever, with a reliable formula for how thick the primes are. The catch is in how it's made: each next step is found by testing candidates until one is prime. The formula predicts how many tests that takes, not which candidate wins.

6. What the 67s and 97s share

proved

They are each other read backwards

67 is 1000011 in binary and 97 is 1100001. On every row the 97s number is the 67s number with its bits reversed. Both are a power of two with a 3 attached: the 67s have it at the back, the 97s at the front.

proved

The 97s' clock is the 67s' clock run backwards

proved

So they have exactly the same odds

Every small prime removes the same share of rows from both families. That's why the forecast in the first rabbit hole gives both the same figure, and why both have 22 live hours out of 60. As far as small primes can tell, they're twins.

measured

Reading a prime backwards helps a little

The two clocks lined up by row

both families can be prime hereonly the 67sonly the 97sneither

measured

Both prime on the same row: 4, 7, 8, 68, and probably never again

measured

Do they go on for ever?

The forecast says yes for each family on its own: about 8.3 more primes every time the power grows tenfold, with no end. That's what everyone expects, and the published lists fit it. But it has never been proved for either family, or for any family of this kind.

What they have in common is nearly everything: same shape mirrored, same clock mirrored, same odds. What they don't share is which hours are live, and those differences are fully decided by five small primes. Neither that nor their mirror symmetry gives a way to produce the next prime of either one.

7. The families whose gaps don't come out round

On the echo pages some families fade in round numbers: 10, then 2, then 0.4. Others, like the families of 4, 5 and 6, fade in 3.33, 0.67, 0.13. The hunch was that those awkward numbers are rounded, that the rounding hides something, and that the behaviour of the families, perhaps even of their primes, lives in what's hidden. Written as fractions, nothing should be lost however far the pattern is extended.

exact

They are thirds, not rounding

3.33 is 10/3. Then 2/3, then 2/15, then 2/75, each a fifth of the last. The tallies are whole-number counts over one whole loop, so nothing is rounded until it's printed. The decimals never end because there is a 3 underneath. The echo pages now print the fractions.

exact

The 3 is the length of the block

An echo's size moves in steps of 25 points divided by the length of the block. 4, 5 and 6 are 100, 101 and 110: every three-bit number that isn't all ones. A block of 3, 6, 9 or 12 bits puts a 3 under the fraction. 7 bits puts a 7 there and 11 bits an 11.

measured

So most families are like this

Of the 24 starting sizes found in families up to 4,095, 15 are decimals that never end. 3,378 of the 4,015 families have a block length that gives them. The round ones are the minority: blocks of 2, 4, 5, 8 or 10 bits.

measured

They land on primes like everyone else

Counting primes in rows 13 to 60 of every family, the unround group found 0.94 of the plain forecast and the round group 0.92. On fresh rows, 61 to 110, it was 0.97 against 0.93. Both sit where a family with no special help should.

proved

The one real link to the 67s

The family of 6 is 110, and that is the lane of 7: it rules out every third power of the 67s. So the 3 in these gaps and the 3 in the 67s' register are the same 3. But a lane only rules powers out, and this one is already in the sieve.

The fractions are the right way to write these sizes, and they are exact for ever: 10/3, 2/3, 2/15 and on. What they describe is how a family's digits lean, which is set by the length of its block. They don't pick out a special few families, and they don't change how often a family lands on a prime. The same wall as the other six holes, reached from the echo side.