← All projects / Mixing the Families

Cross one family with another

Take two families, line them up row by row, and combine them. Invert one by the other, or subtract them. Some mixes fall straight back into a family I already had. Some make new ones. A few turn out to be sequences mathematicians have had names for, for centuries.

The mixer

Pick two families and how to combine them. "Inverted by" means: flip a bit in the first family wherever the second family has a 1.

    RowFirst familySecond familyResult

    Row n is n bits wide in both families, so the bits always line up. Primes are checked for certain up to row 64.

    New families from mixing

    New to this site, that is. Several of them are famous.

    1010 inverted by the 1null1s

    The in-between Holy numbers

    3, 11, 43, 171, 683, 2,731...

    Flip the first and last bit of 10101010 and you get 00101011. These slot in between the 0101 numbers: 1, 3, 5, 11, 21, 43, 85, 171. Each one is the number before it, plus twice the one before that. Together they're called the Jacobsthal numbers, and 0101 minus 1010 gives the whole run in one go.

    In the mixer this one shows two threads taking turns: 3, 11, 43 on the even rows and 7, 27, 107 on the odd rows.

    111000s inverted by 1010

    The sevenths

    2, 18, 146, 1,170...

    Three on, three off, crossed with on, off, gives one on, two off: 010010010. As a fraction 1010 is two thirds and 111000 is eight ninths, and what comes out is two sevenths. Flip which wall you use and you get five sevenths: 101101101.

    97s inverted by the null1nulls

    The Thabit numbers

    5, 11, 23, 47, 95, 191, 383...

    Three times a power of two, minus 1. In binary that's 10 followed by all ones: 95 is 1011111. They're named after Thabit ibn Qurra, who used them in the 800s.

    67s inverted by the null1nulls

    A power of two, minus 3

    5, 13, 29, 61, 125, 253, 509...

    All ones with a single 0 in the second-last place: 61 is 111101. The 67s are a power of two plus 3, and inverting by the null1nulls turns the plus into a minus.

    97s inverted by the 1null1s

    One bit left

    2, 4, 8, 16, 32, 64...

    The 97s are the weakest signal with one extra bit next to the front. Take the weakest signal back out and that bit is all that's left: a pure power of two.

    any family inverted by its mirror

    All ones

    1, 3, 7, 15, 31, 63, 127...

    0101 by 1010, the 1null1s by the null1nulls, the 000111s by the 111000s, the 666s by the 357s: every pair fills the row. These are the Mersenne numbers. The biggest prime anyone knows is one of them, 136,279,841 ones long.

    666s minus the 357s

    One with no name

    1, 3, 5, 9, 19, 39, 77, 155, 309, 619...

    Not one of the ten families and not one of the well-known sequences I check for. Most mixes are like this.

    1null1s inverted by the 111000s, row 9

    313 falls out

    257 inverted by 56 = 313

    Row 9 of the weakest signal is 257: 100000001. Row 9 of the 111000 wall is 56: 000111000. Invert one by the other and you get 100111001, which is 313, the happy prime. That's why 313 reads the same backwards in binary: it's the weakest signal with three ones dropped in the middle.

    What lands where

    MixWhat comes out

    This table is worked out on the spot: every pair of the ten families, inverted and subtracted, compared row by row against the ten families and five well-known sequences. "Rows back" means the result matches that family a few rows earlier.

    Primes in the in-between Holy numbers

    The 0101 family has exactly one prime, which is 5. Its in-between partner, made by inverting 1010 by the weakest signal, is full of them. The numbers are a power of two plus 1, divided by 3.

    Even rows: 3, 11, 43, 171, 683...

    Odd rows: 7, 27, 107, 427, 1,707...

    The other thread of the same mix. Each number is 5 times a power of two, plus 1, divided by 3, and every one of them ends in 7.

    proved

    Even prime rows are always a prime plus 1

    4, 6, 8, 12, 14, 18, 20, 24, 32, 44, 62: take 1 off each and you get 3, 5, 7, 11, 13, 17, 19, 23, 31, 43, 61. No other even row can ever hold a prime.

    proved

    Odd prime rows are always a multiple of 6, plus 1

    7, 13, 25, 31, 37, 73, 145: all one more than a multiple of 6. Past row 3, the other odd rows are dead: one in three divides by 3 and another one in three divides by 7.

    not a rule

    Passing the test doesn't make a row prime

    Rows 30, 38 and 42 are each a prime plus 1, and none of them holds a prime. Rows 19, 43 and 49 are each a multiple of 6 plus 1, and they don't either. The two rules say where to look. They don't say what you'll find.

    313 is on the list

    2 to the power 313, plus 1, divided by 3, is prime. It has 94 digits. So the happy prime turns up twice on this page.

    Every power on the list is itself prime

    3, 5, 7, 11, 13, 17, 19, 23: the list starts with every odd prime in order, and it never contains a number that isn't prime. That part is proved, just below.

    It matches the published list

    These are known as Wagstaff primes. My search found the same powers as the published list, all the way up.

    Shifting by Fibonacci

    The gaps between three of the families are 2, 3 and 5, which are Fibonacci numbers. So what happens if you keep going and shift a family by each Fibonacci number in turn? The 1null1s are a power of two plus 1 and the 67s are a power of two plus 3. The 97s are three times a power of two, plus 1. This table swaps that last number for each Fibonacci number and counts the primes in the first 3,000 rows.

    ShiftPower of two, plus the shift3 × a power of two, plus the shift
    +15 (the 1null1s)21 (the 97s)
    +200
    +325 (the 67s)0
    +51139
    +800
    +13940
    +21260
    +3400
    +551454
    +891231
    +14400
    proved

    Every third Fibonacci shift kills the family

    2, 8, 34 and 144 are even. Add an even number to a power of two and the answer is always even, so there are no primes at all. On the 97s side, 3 and 21 do the same job, because every number then divides by 3.

    measured

    The 97s shifted by 55 beat everything

    54 primes in 3,000 rows, against 21 for the 97s themselves. On the other side the best shift is 21, with 26, just ahead of the 67s.

    proved

    A shift shields the family from its own factors

    If a prime divides the shift, it can never divide the shifted number, because it would have to divide the power of two as well. 55 is 5 × 11, so the 97s shifted by 55 are never hit by 5 or 11. 21 is 3 × 7, so a power of two plus 21 is never hit by 3 or 7.

    measured

    So it's the factors, not Fibonacci

    Build a shift on purpose out of small primes and you get rich families without Fibonacci. A power of two plus 105 (3 × 5 × 7) has 48 primes in 3,000 rows. Three times a power of two plus 85,085 (5 × 7 × 11 × 13 × 17) has 63, the most of anything I've tried. It isn't a perfect dial, though: some built shifts land in the 20s and 30s.

    measured

    Fibonacci rows of the 67s start perfectly, then stop

    Rows 2, 3, 5, 8 and 13 of the 67s are all prime: 3, 7, 19, 131 and 4,099. Row 21 isn't, and neither is any of the next fifteen Fibonacci rows, up to row 17,711.

    Sliding the bits sideways by Fibonacci amounts

    The other way to read "shift": keep the shape, and slide part of it left by 1, 2, 3, 5, 8, 13, 21... places. I tried every Fibonacci amount up to 17,711.

    What gets slidPrime when the slide isThe primes
    67 shape, top bit slid that many places1, 2, 3, 555, 7, 11 and a 17-digit one
    67 shape, that many zeros in the gap1, 2, 5, 1311, 19, 131, 32,771
    97 shape, front pair slid that many places1, 2, 5, 87, 13, 97, 769
    97 shape, that many zeros in the gap1, 513, 193
    1null1 shape, top bit slid that many places1, 2, 83, 5, 257
    A 1 bit at every Fibonacci placeafter 2, 3 and 5 bits3, 7, 47
    measured

    Every version starts well and then dies

    All six find primes in the first few slides and then almost nothing. The one late hit is the 67 shape slid 55 places.

    measured

    Fibonacci numbers run away too fast

    Early slides give small numbers, and small numbers are often prime. After that the Fibonacci numbers get big so quickly that there are hardly any rows left to land on. Using the rule for the average from the primes page, past a slide of 13 you'd expect about half a prime in total, for ever. One late hit out of six tries fits that.

    exact

    Spin the 67 and you get 97, and 7

    Rotate the bits of 67 round in a ring and it passes through 7, 14, 28, 56, 112 and 97. On every row, the only odd numbers a 67s number can spin into are itself, the 97s number on the same row, and 7. Spun by Fibonacci amounts it hops between them in a loop of 16.

    Counts are from tools/shift_search.py in this site's code.

    Subtracting from the strongest signal

    I took the two strongest signals, 0101 and 1010, and subtracted every other family from them, row by row, for the first 2,000 rows. Most of it comes out ordinary. Four things don't.

    Row 10 of each wall. On row 20 the answer is 00000100000000010000, and on row 30 it's the same again with one more copy.

    exact

    666 is the strongest signal, minus 16

    Ten bits of 1010 make 682, and 682 take away 666 is 16. That's one single bit. Carry on down the walls and the 1010 signal minus the 666s is one 1 bit every ten places and nothing else. So the 666 family is the strongest signal with one small dent in every ten bits.

    exact

    357 is the other signal, plus 16

    Ten bits of 0101 make 341, and 341 plus 16 is 357. The same single bit, the other way round. As fractions it's two thirds take away 16 over 1,023, and one third plus 16 over 1,023.

    exact

    Take the weakest from the strongest and the strongest is still there

    10101 minus 10001 is 00100. 1010101 minus 1000001 is 0010100. Knock the two end bits off the signal and what's left is the same signal, four bits shorter, sitting in the middle: 4, 20, 84, 340, which is 4 times 1, 5, 21, 85.

    exact

    Thirds minus ninths are still ninths

    Subtract the three-on, three-off walls from the signal and the answer is three on, three off again: row 16 comes out as 11100011100011. Two thirds minus one ninth is five ninths, and one third minus one ninth is two ninths.

    measured

    The signal survives almost everything

    Subtract the 97s, 67s, 1null1s or null1nulls and the middle of the answer still reads 10101010. Those families only have a bit or two at each end, so that's all they can change.

    measured

    No jackpot of primes

    Half the subtractions are always even. The best of the rest is 0101 minus the null1nulls, with 27 primes in 2,000 rows where ordinary numbers that size would give about 19. Everything else is at or below chance.

    From tools/signal_minus.py in this site's code.

    What can actually be proved

    The endings of these families clearly aren't random, so it's fair to ask whether that gives a proof of something. It does. Here's what can be proved, and where it stops.

    proved

    The last digit always runs in a loop

    The last digit of the next number depends only on the last digit of this one, and on where you are in the pattern. There are only ten digits and a handful of positions, so some combination has to come round again. From then on everything repeats. That holds for every family and every mix on this page.

    proved

    Whole rows are ruled out for ever

    Once the last digit loops, any row that lands on 0, 2, 4, 5, 6 or 8 can never be prime, apart from 2 and 5 themselves. The same argument works for dividing by 3, 7, 11 or any other small prime, because those remainders loop too. In the 67s this proves that half of all rows are never prime.

    proved

    The 0101 family has exactly one prime

    Every 0101 number is the number just below a power of two, times the number just above it, divided by 3. 85 is 15 × 17 ÷ 3. Past 5, both pieces are bigger than 3, so the number always splits. No search is needed.

    proved

    The in-between numbers can only be prime on prime powers

    They are 2 to an odd power, plus 1, divided by 3. If the power splits as a × b, then 2 to the a, plus 1, divides the whole thing, and the number splits as well. So the power has to be prime. That's why the list above has 7 and 11 on it but never 9 or 15.

    not proved

    Where it stops

    Every one of these proofs says where a prime can't be. None says where a prime must be. The rows that survive every rule are the ones that look random, and that's the part nobody has cracked. Even for all ones, the most studied family in mathematics, it isn't known whether the primes ever run out.

    So the tidy endings and the random-looking primes don't clash. The endings are the sieve. The randomness is in what the sieve lets through.