What’s the connection between grandmothers and this set of numbers?

1, 2, 6, 12, 44, 92, 184, 1208, 1256, 4792, 9912, 19832, 39664, 563952, 576464, 4496112, 4499184, 17996528, 17997488, 143972080, 145057520, 145070832, 294967024, 589944560...

To take the first step towards the answer, you need to put the numbers into binary:

1, 10, 110, 1100, 101100, 1011100, 10111000, 10010111000, 10011101000, 1001010111000, 10011010111000, 100110101111000, 1001101011110000, 10001001101011110000, 10001100101111010000, 10001001001101011110000, 10001001010011011110000, 1000100101001101011110000, 1000100101001111010110000, 1000100101001101011011110000, 1000101001010110011011110000, 1000101001011001101011110000, 10001100101001101011011110000, 100011001010011101011011110000...

The second step is compare those binary numbers with these binary numbers, which represent 1 to 30:

1, 10, 11, 100, 101, 110, 111, 1000, 1001, 1010, 1011, 1100, 1101, 1110, 1111, 10000, 10001, 10010, 10011, 10100, 10101, 10110, 10111, 11000, 11001, 11010, 11011, 11100, 11101, 11110...

To see what’s going on, take the first five numbers from each set:

• 1, 10, 110, 1100, 101100...

• 1, 10, 11, 100, 101...

What’s going on? If you look, you can see the *n*-th binary number of set 1 contains the digits of all binary numbers <= *n* in set 2. For example, 101100 is the 5th binary number in set 1, so it contains the digits of the binary numbers 1 to 5:

__1__01100 ← 1

__10__1100 ← 10

10__11__00 ← 11

101__100__ ← 100

__101__100 ← 101

Now try 1256 = 10,011,101,000, the ninth number in set 1. It contains all the binary numbers from 1 to 1001:

__1__0011101000 ← 1 (n=1)

__10__011101000 ← 10 (n=2)

100__11__101000 ← 11 (n=3)

__100__11101000 ← 100 (n=4)

10011__101__000 ← 101 (n=5)

1001__110__1000 ← 110 (n=6)

100__111__01000 ← 111 (n=7)

1001110__1000__ ← 1000 (n=8)

__1001__1101000 ← 1001 (n=9)

But where do grandmothers come in? They come in via this famous toy:

Nested doll or Russian doll

It’s called a Russian doll and the way all the smaller dolls pack inside the largest doll reminds me of the way all the smaller numbers 1 to 1010 pack into 1001010111000. But in the Russian language, as you might expect, Russian dolls aren’t called Russian dolls. Instead, they’re called matryoshki (матрёшки, singular матрёшка), meaning “little matrons”. However, there’s a mistaken idea in English that in Russian they’re called babushka dolls, from Russian бабушка, *babuška*, meaning “grandmother”. And that’s what I thought, until I did a little research.

But the mistake is there, so I’ll call these babushka numbers or grandmother numbers:

1, 2, 6, 12, 44, 92, 184, 1208, 1256, 4792, 9912, 19832, 39664, 563952, 576464, 4496112, 4499184, 17996528, 17997488, 143972080, 145057520, 145070832, 294967024, 589944560...

They’re sequence A261467 at the *Online Encyclopedia of Integer Sequences*. They go on for ever, but the biggest known so far is 589,944,560 = 100,011,001,010,011,101,011,011,110,000 in binary. And here is that binary babushka with its binary babies:

__1__00011001010011101011011110000 ← 1 (n=1)

__10__0011001010011101011011110000 ← 10 (n=2)

1000__11__001010011101011011110000 ← 11 (n=3)

__100__011001010011101011011110000 ← 100 (n=4)

10001100__101__0011101011011110000 ← 101 (n=5)

1000__110__01010011101011011110000 ← 110 (n=6)

1000110010100__111__01011011110000 ← 111 (n=7)

__1000__11001010011101011011110000 ← 1000 (n=8)

10001__1001__010011101011011110000 ← 1001 (n=9)

10001100__1010__011101011011110000 ← 1010 (n=10)

10001100101001110__1011__011110000 ← 1011 (n=11)

1000__1100__1010011101011011110000 ← 1100 (n=12)

10001100101001__1101__011011110000 ← 1101 (n=13)

1000110010100__1110__1011011110000 ← 1110 (n=14)

1000110010100111010110__1111__0000 ← 1111 (n=15)

1000110010100111010110111__10000__ ← 10000 (n=16)

__10001__1001010011101011011110000 ← 10001 (n=17)

10001__10010__10011101011011110000 ← 10010 (n=18)

1000110010__10011__101011011110000 ← 10011 (n=19)

10001100__10100__11101011011110000 ← 10100 (n=20)

100011001010011__10101__1011110000 ← 10101 (n=21)

10001100101001110__10110__11110000 ← 10110 (n=22)

10001100101001110101__10111__10000 ← 10111 (n=23)

100011001010011101011011__11000__0 ← 11000 (n=24)

1000__11001__010011101011011110000 ← 11001 (n=25)

10001100101001__11010__11011110000 ← 11010 (n=26)

1000110010100111010__11011__110000 ← 11011 (n=27)

10001100101001110101101__11100__00 ← 11100 (n=28)

1000110010100__11101__011011110000 ← 11101 (n=29)

1000110010100111010110__11110__000 ← 11110 (n=30)

Babushka numbers exist in higher bases, of course. Here are the first thirteen in base 3 or ternary:

1 contains 1 (c=1) (n=1)

12 contains 1, 2 (c=2) (n=5)

102 contains 1, 2, 10 (c=3) (n=11)

1102 contains 1, 2, 10, 11 (c=4) (n=38)

10112 contains 1, 2, 10, 11, 12 (c=5) (n=95)

101120 contains 1, 2, 10, 11, 12, 20 (c=6) (n=285)

1021120 contains 1, 2, 10, 11, 12, 20, 21 (c=7) (n=933)

10211220 contains 1, 2, 10, 11, 12, 20, 21, 22 (c=8) (n=2805)

100211220 contains 1, 2, 10, 11, 12, 20, 21, 22, 100 (c=9) (n=7179)

10021011220 contains 1, 2, 10, 11, 12, 20, 21, 22, 100, 101 (c=10) (n=64284)

1001010211220 contains 1, 2, 10, 11, 12, 20, 21, 22, 100, 101, 102 (c=11) (n=553929)

1001011021220 contains 1, 2, 10, 11, 12, 20, 21, 22, 100, 101, 102, 110 (c=12) (n=554253)

10010111021220 contains 1, 2, 10, 11, 12, 20, 21, 22, 100, 101, 102, 110, 111 (c=13) (n=1663062)

Look at 1,001,010,211,220 (n=553929) and 1,001,011,021,220 (n=554253). They have the same number of digits, but the babushka 1,001,011,021,220 manages to pack in one more baby:

1001010211220 contains 1, 2, 10, 11, 12, 20, 21, 22, 100, 101, 102 (c=11) (n=553929)

1001011021220 contains 1, 2, 10, 11, 12, 20, 21, 22, 100, 101, 102, 110 (c=12) (n=554253)

That happens in binary too:

10010111000 contains 1, 10, 11, 100, 101, 110, 111, 1000, 1001 (c=9) (n=1208)

10011101000 contains 1, 10, 11, 100, 101, 110, 111, 1000, 1001, 1010 (c=10) (n=1256)

What happens in higher bases? Watch this space.