Nexcelsior

In “The Trivial Troot”, I looked at what happens when tri(k), the k-th triangular number, is one digit longer than the previous triangular number, tri(k-1):


6 = tri(3)
10 = tri(4)


91 = tri(13)
105 = tri(14)


990 = tri(44)
1035 = tri(45)
[...]

10 ← 4
105 ← 14
1035 ← 45
10011 ← 141
100128 ← 447
1000405 ← 1414
10001628 ← 4472
100005153 ← 14142
1000006281 ← 44721
10000020331 ← 141421
100000404505 ← 447214
1000001326005 ← 1414214
10000002437316 ← 4472136
100000012392316 ← 14142136
[...]

What’s going on with k? In a sense, it’s calculating the square roots of 2 and 20:

√2 = 1·414213562373095048801688724209698078569671875376948073176679738...
√20 = 4·472135954999579392818347337462552470881236719223051448541794491...

Now let’s say “Excelsior!” and go higher with a related sequence. A006003 is defined at the Online Encyclopedia of Integer Sequences as the “sum of the next n natural numbers”. Here it is:


1 = 1
5 = 2 + 3
15 = 4 + 5 + 6
34 = 7 + 8 + 9 + 10
65 = 11 + 12 + 13 + 14 + 15
111 = 16 + 17 + 18 + 19 + 20 + 21
175 = 22 + 23 + 24 + 25 + 26 + 27 + 28
260 = 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36
369 = 37 + 38 + 39 + 40 + 41 + 42 + 43 + 44 + 45
505 = 46 + 47 + 48 + 49 + 50 + 51 + 52 + 53 + 54 + 55
671 = 56 + 57 + 58 + 59 + 60 + 61 + 62 + 63 + 64 + 65 + 66
870 = 67 + 68 + 69 + 70 + 71 + 72 + 73 + 74 + 75 + 76 + 77 + 78
1105 = 79 + 80 + 81 + 82 + 83 + 84 + 85 + 86 + 87 + 88 + 89 + 90 + 91
1379 = 92 + 93 + 94 + 95 + 96 + 97 + 98 + 99 + 100 + 101 + 102 + 103 + 104 + 105
1695 = 106 + 107 + 108 + 109 + 110 + 111 + 112 + 113 + 114 + 115 + 116 + 117 + 118 + 119 + 120
2056 = 121 + 122 + 123 + 124 + 125 + 126 + 127 + 128 + 129 + 130 + 131 + 132 + 133 + 134 + 135 + 136
2465 = 137 + 138 + 139 + 140 + 141 + 142 + 143 + 144 + 145 + 146 + 147 + 148 + 149 + 150 + 151 + 152 + 153
2925 = 154 + 155 + 156 + 157 + 158 + 159 + 160 + 161 + 162 + 163 + 164 + 165 + 166 + 167 + 168 + 169 + 170 + 171
3439 = 172 + 173 + 174 + 175 + 176 + 177 + 178 + 179 + 180 + 181 + 182 + 183 + 184 + 185 + 186 + 187 + 188 + 189 + 190
4010 = 191 + 192 + 193 + 194 + 195 + 196 + 197 + 198 + 199 + 200 + 201 + 202 + 203 + 204 + 205 + 206 + 207 + 208 + 209 + 210
[...]

If you’re familiar with triangular numbers, you’ll see that sumnext(k) is always higher than tri(k), except for sumnext(1) = 1 = tri(k). Now, this is what happens when sumnext(k) is one digit longer than sumnext(k-1):


5 = sumnext(2)
15 = sumnext(3)


65 = sumnext(5)
111 = sumnext(6)


870 ← 12
1105 ← 13


9855 ← 27
10990 ← 28


97585 ← 58
102719 ← 59


976625 ← 125
1000251 ← 126


9951391 ← 271
10061960 ← 272


99588644 ← 584
100101105 ← 585


997809119 ← 1259
1000188630 ← 1260


9995386529 ← 2714
10006439295 ← 2715
[...]

15 ← 3
111 ← 6
1105 ← 13
10990 ← 28
102719 ← 59
1000251 ← 126
10061960 ← 272
100101105 ← 585
1000188630 ← 1260
10006439295 ← 2715
100049490449 ← 5849
1000188006300 ← 12600
10000910550385 ← 27145
100003310078561 ← 58481
1000021311323825 ← 125993
10000026341777165 ← 271442
100000232056567634 ← 584804
1000002262299152685 ← 1259922
10000004237431278525 ← 2714418
100000026858987459346 ← 5848036
1000000119305407615071 ← 12599211
10000000921801015908705 ← 27144177
100000001209342964609615 ← 58480355
1000000000250317736274865 ← 125992105
10000000037633414521952245 ← 271441762
100000000183357362892853070 ← 584803548
1000000000250317673908773025 ← 1259921050
[...]


What’s going on now? In a sense, the digits of k are approximating the cube roots of 20, 200 and 2000:


2.714417616594906571518089469679489204805107769489096957284365443... = cuberoot(20)
5.848035476425732131013574720275845557060997270202060082845147020... = cuberoot(200)
12.59921049894873164767210607278228350570251464701507980081975112... = cuberoot(2000)


cuberoot(20) = 2.714417616594906571518089469679489204805107769489096957284365443...
cuberoot(200) = 5.848035476425732131013574720275845557060997270202060082845147020...
cuberoot(2000) = 12.59921049894873164767210607278228350570251464701507980081975112...


So you could say that this sequence has gone nexcelsior: sumnext(k) > tri(k); cubes are higher than squares; and (20, 200, 2000) is bigger than (2, 20).


Previously Pre-Posted…

• “The Trivial Troot” — explaining the earlier pattern in triangular numbers

Agogic Arithmetic

This is one of my favorite integer sequences:

• 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66, 78, 91, 105, 120, 136, 153, 171, 190, 210, 231, 253, 276, 300, 325, 351, 378, 406, 435, 465, 496, 528, 561, 595, 630, 666, 703, 741, 780, 820, 861, 903, 946, 990, 1035, 1081, 1128, 1176, 1225, 1275, 1326, 1378, 1431, ... — A000217 at OEIS



And it’s easy to work out the rule that generates the sequence. It’s the sequence of triangular numbers, of course, which you get by summing the integers:

1
1 + 2 = 3
3 + 3 = 6
6 + 4 = 10
10 + 5 = 15
15 + 6 = 21
21 + 7 = 28
28 + 8 = 36
36 + 9 = 45
[...]


I like this sequence too, but it isn’t a sequence of integers and it’s much harder to work out the rule that generates it:

• 1, 3/2, 11/6, 25/12, 137/60, 49/20, 363/140, 761/280, 7129/2520, 7381/2520, 83711/27720, 86021/27720, 1145993/360360, 1171733/360360...


But you could say that it’s the inverse of the triangular numbers, because you generate it like this:

1
1 + 1/2 = 3/2
3/2 + 1/3 = 11/6
11/6 + 1/4 = 25/12
25/12 + 1/5 = 137/60
137/60 + 1/6 = 49/20
49/20 + 1/7 = 363/140
363/140 + 1/8 = 761/280
761/280 + 1/9 = 7129/2520
[...]

It’s the harmonic series, which is defined at Wikipedia as “the infinite series formed by summing all positive unit fractions”. I can’t understand its subtleties or make any important discoveries about it, but I thought I could ask (and begin to answer) a question that perhaps no-one else in history had ever asked: When are the leading digits of the k-th harmonic number, hs(k), equal to the digits of k in base 10?

hs(1) = 1
hs(43) = 4.349...
hs(714) = 7.1487...
hs(715) = 7.1501...
hs(9763) = 9.76362...
hs(122968) = 12.296899...
hs(122969) = 12.296907...
hs(1478366) = 14.7836639...
hs(17239955) = 17.23995590...
hs(196746419) = 19.6746419...
hs(2209316467) = 22.0931646788...


Do those numbers have any true mathematical significance? I doubt it. But they were fun to find, even though I wasn’t the first person in history to ask about them:

• 1, 43, 714, 715, 9763, 122968, 122969, 1478366, 17239955, 196746419, 2209316467, 24499118645, 268950072605 — A337904 at OEIS, Numbers k such that the decimal expansion of the k-th harmonic number starts with the digits of k, in the same order.

Magiciprocal


A021023 Decimal expansion of 1/19.

0, 5, 2, 6, 3, 1, 5, 7, 8, 9, 4, 7, 3, 6, 8, 4, 2, 1, 0, 5, 2, 6, 3, 1, 5, 7, 8, 9, 4, 7, 3, 6, 8, 4, 2, 1, 0, 5, 2, 6, 3, 1, 5, 7, 8, 9, 4, 7, 3, 6, 8, 4, 2, 1, 0, 5, 2, 6, 3, 1, 5, 7, 8, 9, 4, 7, 3, 6, 8, 4, 2, 1, 0, 5, 2, 6, 3, 1, 5, 7, 8, 9, 4, 7, 3, 6, 8, 4, 2, 1, 0, 5, 2, 6, 3, 1, 5, 7, 8 [...] The magic square that uses the decimals of 1/19 is fully magic. — A021023 at the Online Encyclopedia of Integer Sequences

Mötley Vüe

Here’s the Fibonacci sequence, where each term (after the first two) is created by adding the two previous numbers:


1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765...

In “Fib and Let Tri”, I described how my eye was caught by 55, which is a palindrome, reading the same backwards and forwards. “Were there any other Fibonacci palindromes?” I wondered. So I looked to see. Now my eye has been caught by 55 again, but for another reason. It should be easy to spot another interesting aspect to 55 when the Fibonacci numbers are set out like this:


fib(1) = 1
fib(2) = 1
fib(3) = 2
fib(4) = 3
fib(5) = 5
fib(6) = 8
fib(7) = 13
fib(8) = 21
fib(9) = 34
fib(10) = 55
fib(11) = 89
fib(12) = 144
fib(13) = 233
fib(14) = 377
fib(15) = 610
fib(16) = 987
fib(17) = 1597
fib(18) = 2584
fib(19) = 4181
fib(20) = 6765
[...]

55 is fib(10), the 10th Fibonacci number, and 5+5 = 10. That is, digsum(fib(10)) = 10. What other Fibonacci numbers work like that? I soon found some and confirmed my answer at the Online Encyclopedia of Integer Sequences:


1, 5, 10, 31, 35, 62, 72, 175, 180, 216, 251, 252, 360, 494, 504, 540, 946, 1188, 2222 — A020995 at OEIS

And that seems to be the lot, according to the OEIS. In base 10, at least, but why stop at base 10? When I looked at base 11, the numbers of digsum(fib(k)) = k didn’t stop coming, because I couldn’t take the Fibonacci numbers very high on my computer. But the OEIS gives a much longer list, starting like this:


1, 5, 13, 41, 53, 55, 60, 61, 90, 97, 169, 185, 193, 215, 265, 269, 353, 355, 385, 397, 437, 481, 493, 617, 629, 630, 653, 713, 750, 769, 780, 889, 905, 960, 1013, 1025, 1045, 1205, 1320, 1405, 1435, 1501, 1620, 1650, 1657, 1705, 1735, 1769, 1793, 1913, 1981, 2125, 2153, 2280, 2297, 2389, 2413, 2460, 2465, 2509, 2533, 2549, 2609, 2610, 2633, 2730, 2749, 2845, 2893, 2915, 3041, 3055, 3155, 3209, 3360, 3475, 3485, 3521, 3641, 3721, 3749, 3757, 3761, 3840, 3865, 3929, 3941, 4075, 4273, 4301, 4650, 4937, 5195, 5209, 5435, 5489, 5490, 5700, 5917, 6169, 6253, 6335, 6361, 6373, 6401, 6581, 6593, 6701, 6750, 6941, 7021, 7349, 7577, 7595, 7693, 7740, 7805, 7873, 8009, 8017, 8215, 8341, 8495, 8737, 8861, 8970, 8995, 9120, 9133, 9181, 9269, 9277, 9535, 9541, 9737, 9935, 9953, 10297, 10609, 10789, 10855, 11317, 11809, 12029, 12175... — A025490 at OEIS

The list ends with 1636597 = A18666[b11] and the OEIS says that 1636597 almost certainly completes the list. According to David C. Terr’s paper “On the Sums of Fibonacci Numbers” (pdf), published in the Fibonacci Quarterly in 1996, the estimated digit-sum for the k-th Fibonacci number in base b is given by the formula (b-1)/2 * k * log(b,φ), where log(b,φ) is the logarithm in base b of the golden ratio, 1·61803398874… Terr then notes that the simplified formula (b-1)/2 * log(b,φ) gives the estimated average ratio digsum(fib(k)) / k in base b. Here are the estimates for bases 2 to 20:


b02 = 0.3471209568153086...
b03 = 0.4380178794859424...
b04 = 0.5206814352229629...
b05 = 0.5979874356654401...
b06 = 0.6714235829697111...
b07 = 0.7418818776805580...
b08 = 0.8099488992357201...
b09 = 0.8760357589718848...
b10 = 0.9404443811249043...
b11 = 1.0034045909311624...
b12 = 1.0650963641043091...
b13 = 1.1256639207937723...
b14 = 1.1852250528196852...
b15 = 1.2438775226715552...
b16 = 1.3017035880574074...
b17 = 1.3587732842474014...
b18 = 1.4151468584732730...
b19 = 1.4708766105122322...
b20 = 1.5260083080264088...

In base 2, you can expect digsum(fib(k)) to be much smaller than k; in base 20, you can expect digsum(fib(k)) to be much larger. But as you can see, the estimate for base 11, 1.0034045909311624…, is very nearly 1. That’s why base 11 produces so many results for digsum(fib(k)) = k, because only a slight deviation from the estimate might create a perfect ratio of 1 for digsum(fib(k)) / k, i.e. digsum(fib(k)) = k. But in the end the results run out in base 11 too, because as k gets higher and fib(k) gets bigger, the estimate becomes more and more accurate and digsum(fib(k)) > k. With lower k, digsum(fib(k)) can easily fall below k or match k. That happens in other bases, but because their estimates are further from 1, results for digsum(fib(k)) = k run out much more quickly.

To see this base behavior represented visually, I’ve created Ulam-like spirals for k using three colors: blue for digsum(fib(k)) < k, yellow for digsum(fib(k)) > k, and red for digsum(fib(k)) = k (with the green square at the center representing fib(1) = 1). As you can see below, the spiral for base 11 immediately stands out. It’s motley, not dominated by blue or yellow like the other spirals:

Spiral for digsum(fib(k)) in base 9
(blue for digsum(fib(k)) < k, yellow for digsum(fib(k)) > k, red for digsum(fib(k)) = k, green for fib(1))


Spiral for digsum(fib(k)) in base 10


Spiral for digsum(fib(k)) in base 11 — a motley view of blue, yellow and red


Spiral for digsum(fib(k)) in base 12


Spiral for digsum(fib(k)) in base 13


Finally, here are spirals at higher and higher resolution for digsum(fib(k)) = k in base 11:

digsum(fib(k)) = k in base 11 (low resolution)
(green square is fib(1))


digsum(fib(k)) = k in base 11 (x2 resolution)


digsum(fib(k)) = k in base 11 (x4)


digsum(fib(k)) = k in base 11 (x8)


digsum(fib(k)) = k in base 11 (x16)


digsum(fib(k)) = k in base 11 (x32)


digsum(fib(k)) = k in base 11 (x64)


digsum(fib(k)) = k in base 11 (x128)


digsum(fib(k)) = k in base 11 (animated)

Triangular Squares

The numbers that are both square and triangular are beautifully related to the best approximations to √2:

Number

Square Root

Factors of root

1 1 1
36 6 2 * 3
1225 35 5 * 7
41616 204 12 * 17

and so on.

In each case the factors of the root are the numerator and denominator of the next approximation to √2. — David Wells, The Penguin Dictionary of Curious and Interesting Mathematics (1986), entry for “36”.


Elsewhere other-accessible

A001110 — Square triangular numbers: numbers that are both triangular and square

Prime Times

The factorial of an integer is equal to that that integer multiplied by all the integers smaller than it. For example, this is factorial(7) or 7!:

7! = 7 * 6 * 5 * 4 * 3 * 2 * 1 = 5040

The primorial of a prime is equal to that that prime multiplied by all the primes smaller than it. For example, this is primorial(7):

primorial(7) = 7 * 5 * 3 * 2 = 210 = 4# (the product of the first four primes)

Here’s an interesting set of primorials incremented-by-one:

primorial(2) + 1 = 2 + 1 = 3 (prime)
primorial(3) + 1 = 2*3 + 1 = 7 (prime)
primorial(5) + 1 = 2*3*5 + 1 = 31 (prime)
primorial(7) + 1 = 2*3*5*7 + 1 = 211 (prime)
primorial(11) + 1 = 2*3*5*7*11 + 1 = 2311 (prime)
primorial(31) + 1 = 2*3*5*7*11*13*17*19*23*29*31 + 1 = 200560490131 (prime)
primorial(379) + 1 = 1,719,620,105,458,406,433,483,340,568,317,543,019,584,575,635,895,742,560,438,771,105,058,321,655,238,562,613,083,979,651,479,555,788,009,994,557,822,024,565,226,932,906,295,208,262,756,822,275,663,694,111 (prime)
primorial(1019) + 1 = 20,404,068,993,016,374,194,542,464,172,774,607,695,659,797,117,423,121,913,227,131,032,339,026,169,175,929,902,244,453,757,410,468,728,842,929,862,271,605,567,818,821,685,490,676,661,985,389,839,958,622,802,465,986,881,376,139,404,138,376,153,096,103,140,834,665,563,646,740,160,279,755,212,317,501,356,863,003,638,612,390,661,668,406,235,422,311,783,742,390,510,526,587,257,026,500,302,696,834,793,248,526,734,305,801,634,165,948,702,506,367,176,701,233,298,064,616,663,553,716,975,429,048,751,575,597,150,417,381,063,934,255,689,124,486,029,492,908,966,644,747,931 (prime)
primorial(1021) + 1 = 20,832,554,441,869,718,052,627,855,920,402,874,457,268,652,856,889,007,473,404,900,784,018,145,718,728,624,430,191,587,286,316,088,572,148,631,389,379,309,284,743,016,940,885,980,871,887,083,026,597,753,881,317,772,605,885,038,331,625,282,052,311,121,306,792,193,540,483,321,703,645,630,071,776,168,885,357,126,715,023,250,865,563,442,766,366,180,331,200,980,711,247,645,589,424,056,809,053,468,323,906,745,795,726,223,468,483,433,625,259,000,887,411,959,197,323,973,613,488,345,031,913,058,775,358,684,690,576,146,066,276,875,058,596,100,236,112,260,054,944,287,636,531 (prime)
primorial(2657) + 1 = 78,244,737,296,323,701,708,091,142,569,062,680,832,012,147,734,404,650,078,590,391,114,054,859,290,061,421,837,516,998,655,549,776,972,299,461,276,876,623,748,922,539,131,984,799,803,433,363,562,299,977,701,808,549,255,204,262,920,151,723,624,296,938,777,341,738,751,806,450,993,015,446,712,522,509,989,316,673,420,506,749,359,414,629,957,842,716,112,900,306,643,009,542,215,969,000,431,330,219,583,111,410,996,807,066,475,261,560,303,182,609,636,056,108,367,412,324,508,444,341,178,028,289,201,803,518,093,842,982,877,662,621,552,756,279,669,241,303,362,152,895,160,479,720,040,128,335,518,247,125,849,521,099,841,272,983,588,935,580,888,630,036,283,712,163,901,558,436,498,481,482,160,712,530,124,868,714,141,094,634,892,999,056,865,426,200,254,647,241,979,548,935,087,621,308,526,547,138,125,987,102,062,688,568,486,250,939,447,065,798,353,626,745,169,380,579,442,233,006,898
,444,700,264,240,321,482,823,859,842,044,524,114,576,784,795,294,818,755,525,169,192,652,108,755,230,262,128,210,258,672,754,900,845,837,728,345,782,457,465,793,874,408,469,588,052,577,208,643,754,019,053,756,394,151,041,512,099,598,925,557,724,343,099,264,685,155,934,891,439,161,866,250,113,047,185,553,511,797,406,764,115,907,248,713,405,817,594,729,550,600,082,808,324,331,387,143,679,800,355,356,811,873,430,669,962,333,651,282,822,030,473,702,042,073,141,618,450,021,084,993,659,382,646,598,194,115,178,864,433,545,186,250,667,775,794,249,961,932,761,063,071,117,967,553,887,984,011,652,643,245,393,971 (prime)
primorial(3229) + 1 = 689,481,240,122,180,255,681,227,812,346,871,771,457,221,628,238,467,511,261,402,638,443,056,696,165,896,544,725,098,860,107,293,247,422,610,010,824,870,599,655,026,129,367,004,672,337,297,193,288,816,463,520,704,235,722,580,204,218,943,598,425,089,855,869,341,564,771,022,924,163,236,141,415,235,947,085,902,422,536,824,665,765,244,189,167,643,048,218,572,769,125,400,511,177,245,717,452,516,267,205,786,258,497,574,258,715,214,994,129,786,103,824,740,384,634,788,909,041,221,747,073,062,941,769,355,745,272,170,421,584,636,198,911,899,164,272,930,590,704,655,882,680,817,754,473,306,122,122,423,384,160,639,995,940,152,584,830,810,911,265,680,382,263,051,658,031,509,463,010,733,595,465,426,943,956,643,445,876,702,680,730,987,739,513,538,299,069,540,636,616,098,525,527,546,435,002,783,615,353,417,794,625,251,129,892,373,849,727,119,530,335,366,131,575,986,221,685,088,118,143,088,371,896,087,248,659,669,154,564,925,048,225,211,644,681,303,874,490,648,860,319,990,785,185,350,796,853,298,548,942,407,689,617,641,587,755,314,125,485,345,107,782,298,938,892,240,282,038,605,672,241,010,302,874,153,509,795,545,077,305,234,459,038,983,235,361,138,814,897,166,376,363,090,128,647,084,552,385,969,054,439,430,382,421,762,883,708,894,899,853,286,109,068,224,980,793,075,241,538,872,287,253,835,877,394,821,667,363,465,425,187,353,453,157,415,169,810,167,271,517,665,273,484,442,461,468,031,313,956,356,871,467,191,959,110,440,864,194,544,244,079,053,955,897,287,010,339,385,419,923,838,571,256,564,818,350,769,518,898,003,780,557,167,344,272,499,224,580,817,920,441,512,610,104,625,622,872,289,967,615,843,092,782,763,554,732,404,239,287,463,466,833,602,966,629,613,502,579,134,371,295,289,680,374,088,987,611,189,907,873,072,122,808,833,765,972,650,050,982,877,578,244,899,073,193,043,546,490,795,625,023,568,563,926,988,371 (prime)


Elsewhere Other-Accessible

A005234 at the Online Encylopedia of Integer Sequences — “Primorial plus 1 primes: primes p such that 1 + product of primes up to p is prime”.

Count Amounts

One of my favourite integer sequences is what I call the digit-line. You create it by taking this very familiar integer sequence:

• 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20…

And turning it into this one:

• 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 0, 1, 1, 1, 2, 1, 3, 1, 4, 1, 5, 1, 6, 1, 7, 1, 8, 1, 9, 2, 0… (A033307 in the Online Encyclopedia of Integer Sequences)

You simply chop all numbers into single digits. What could be simpler? Well, creating the digit-line couldn’t be simpler, but it is in fact a very complex object. There are hidden depths in its patterns, as even a brief look will uncover. For example, you can try counting the digits as they appear one-by-one in the line and seeing whether the digit-counts compare. Do the 1s of the digit-line always outnumber the 0s, as you might expect? Yes, they do (unless you start the digit-line 0, 1, 2, 3…). But do the 2s always outnumber the 0s? No: at position 2, there’s a 2, and at position 11 there’s a 0. So that’s one 2 and one 0. Does it happen again? Yes, it happens again at the 222nd digit of the digit-line, as below:

1, 2count=1, 3, 4, 5, 6, 7, 8, 9, 1, 0count=1, 1, 1, 1, 22, 1, 3, 1, 4, 1, 5, 1, 6, 1, 7, 1, 8, 1, 9, 23, 02, 24, 1, 25, 26, 27, 3, 28, 4, 29, 5, 210, 6, 211, 7, 212, 8, 213, 9, 3, 03, 3, 1, 3, 214, 3, 3, 3, 4, 3, 5, 3, 6, 3, 7, 3, 8, 3, 9, 4, 04, 4, 1, 4, 215, 4, 3, 4, 4, 4, 5, 4, 6, 4, 7, 4, 8, 4, 9, 5, 05, 5, 1, 5, 216, 5, 3, 5,4, 5, 5, 5, 6, 5, 7, 5, 8, 5, 9, 6, 06, 6, 1, 6, 217, 6, 3, 6, 4, 6, 5, 6, 6, 6, 7, 6, 8, 6, 9, 7, 07, 7, 1, 7, 218, 7, 3, 7, 4, 7, 5, 7, 6, 7, 7, 7, 8, 7, 9, 8, 08, 8, 1, 8, 219, 8, 3, 8, 4, 8, 5, 8, 6, 8, 7, 8, 8, 8, 9, 9, 09, 9, 1, 9, 220, 9, 3, 9, 4, 9, 5, 9, 6, 9, 7, 9, 8, 9, 9, 1, 010, 011, 1, 012, 1, 1, 013, 221, 1, 014, 3, 1, 015, 4, 1, 016, 5, 1, 017, 6, 1, 018, 7, 1, 019, 8, 1, 020, 9, 1, 1, 021

So count(2) = count(0) = 1 at digit 11 of the digit-line in the 0 of what was originally 10. And count(2) = count(0) = 21 @ digit 222 in the 0 of what was originally 110. Is a pattern starting to emerge? Yes, it is. Here are the first few points at which the count(2) = count(0) in the digit-line of base 10:

1 @ 11 in 10
21 @ 222 in 110
321 @ 3333 in 1110
4321 @ 44444 in 11110
54321 @ 555555 in 111110
654321 @ 6666666 in 1111110
7654321 @ 77777777 in 11111110
87654321 @ 888888888 in 111111110
987654321 @ 9999999999 in 1111111110
10987654321 @ 111111111110 in 11111111110
120987654321 @ 1222222222221 in 111111111110
[...]

The count(2) = count(0) = 321 at position 3333 in the digit-line, and 4321 at position 44444, and 54321 at position 555555, and so on. I don’t understand why these patterns occur, but you can predict the count-and-position of 2s and 0s easily until position 9999999999, after which things become more complicated. Related patterns for 2 and 0 occur in all other bases except binary (which doesn’t have a 2 digit). Here’s base 6:

1 @ 11 in 10 (1 @ 7 in 6)
21 @ 222 in 110 (13 @ 86 in 42)
321 @ 3333 in 1110 (121 @ 777 in 258)
4321 @ 44444 in 11110 (985 @ 6220 in 1554)
54321 @ 555555 in 111110 (7465 @ 46655 in 9330)
1054321 @ 11111110 in 1111110 (54121 @ 335922 in 55986)
12054321 @ 122222221 in 11111110 (380713 @ 2351461 in 335922)
132054321 @ 1333333332 in 111111110 (2620201 @ 16124312 in 2015538)
1432054321 @ 14444444443 in 1111111110 (17736745 @ 108839115 in 12093234)
15432054321 @ 155555555554 in 11111111110 (118513705 @ 725594110 in 72559410)
205432054321 @ 2111111111105 in 111111111110 (783641641 @ 4788921137 in 435356466)
2205432054321 @ 22222222222220 in 1111111111110 (5137206313 @ 31345665636 in 2612138802)

And what about comparing other pairs of digits? In fact, the count of all digits except 0 matches infinitely often. To write the numbers 1..9 takes one of each digit (except 0). To write the numbers 1 to 99 takes twenty of each digit (except 0). Here’s the proof:

11, 21, 31, 41, 51, 61, 71, 81, 91, 12, 01, 13, 14, 15, 22, 16, 32, 17, 42, 18, 52, 19, 62, 110, 72, 111, 82, 112, 92, 23, 02, 24, 113, 25, 26, 27, 33, 28, 43, 29, 53, 210, 63, 211, 73, 212, 83, 213, 93, 34, 03, 35, 114, 36, 214, 37, 38, 39, 44, 310, 54, 311, 64, 312, 74, 313, 84, 314, 94, 45, 04, 46, 115, 47, 215, 48, 315, 49, 410, 411, 55, 412, 65, 413, 75, 414, 85, 415, 95, 56, 05, 57, 116, 58, 216, 59, 316, 510, 416, 511, 512, 513, 66, 514, 76, 515, 86, 516, 96, 67, 06, 68, 117, 69, 217, 610, 317, 6
11
, 417, 612, 517, 613, 614, 615, 77, 616, 87, 617, 97, 78, 07, 79, 118, 710, 218, 711, 318, 712, 418, 713, 518, 714, 618, 715, 716, 717, 88, 718, 98, 89, 08, 810, 119, 811, 219, 812, 319, 813, 419, 814, 519, 815, 619, 816, 719, 817, 818, 819, 99, 910, 09, 911, 120, 912, 220, 913, 320, 914, 420, 915, 520, 916, 620, 917, 720, 918, 820, 919, 920

And what about writing 1..999, 1..9999, and so on? If you think about it, for every pair of non-zero digits, d1 and d2, all numbers containing one digit can be matched with a number containing the other. 100 → 200, 111 → 222, 314 → 324, 561189571 → 562289572, and so on. So in counting 1..999, 1..9999, 1..99999, you use the same number of non-zero digits. And once again a pattern emerges:

count(0) = 0; count(1) = 1; count(2) = 1; count(3) = 1; count(4) = 1; count(5) = 1; count(6) = 1; count(7) = 1; count(8) = 1; count(9) = 1 (writing 1..9)
count(0) = 9; count(1) = 20; count(2) = 20; count(3) = 20; count(4) = 20; count(5) = 20; count(6) = 20; count(7) = 20; count(8) = 20; count(9) = 20 (writing 1..99)
0: 189; 1: 300; 2: 300; 3: 300; 4: 300; 5: 300; 6: 300; 7: 300; 8: 300; 9: 300 (writing 1..999)
0: 2889; 1: 4000; 2: 4000; 3: 4000; 4: 4000; 5: 4000; 6: 4000; 7: 4000; 8: 4000; 9: 4000 (writing 1..9999)
0: 38889; 1: 50000; 2: 50000; 3: 50000; 4: 50000; 5: 50000; 6: 50000; 7: 50000; 8: 50000; 9: 50000 (writing 1..99999)
0: 488889; 1: 600000; 2: 600000; 3: 600000; 4: 600000; 5: 600000; 6: 600000; 7: 600000; 8: 600000; 9: 600000 (writing 1..999999)
0: 5888889; 1: 7000000; 2: 7000000; 3: 7000000; 4: 7000000; 5: 7000000; 6: 7000000; 7: 7000000; 8: 7000000; 9: 7000000 (writing 1..9999999)
[...]

And here’s base 6 again:

0: 0; 1: 1; 2: 1; 3: 1; 4: 1; 5: 1 (writing 1..5)
0: 5; 1: 20; 2: 20; 3: 20; 4: 20; 5: 20 (writing 1..55 in base 6)
0: 145; 1: 300; 2: 300; 3: 300; 4: 300; 5: 300 (writing 1..555)
0: 2445; 1: 4000; 2: 4000; 3: 4000; 4: 4000; 5: 4000 (writing 1..5555)
0: 34445; 1: 50000; 2: 50000; 3: 50000; 4: 50000; 5: 50000 (writing 1..55555)
0: 444445; 1: 1000000; 2: 1000000; 3: 1000000; 4: 1000000; 5: 1000000 (writing 1..555555)
0: 5444445; 1: 11000000; 2: 11000000; 3: 11000000; 4: 11000000; 5: 11000000 (writing 1..5555555)
0: 104444445; 1: 120000000; 2: 120000000; 3: 120000000; 4: 120000000; 5: 120000000 (writing 1..55555555)
0: 1144444445; 1: 1300000000; 2: 1300000000; 3: 1300000000; 4: 1300000000; 5: 1300000000 (writing 1..555555555)

B a Pal

As a keyly committed core component of the counter-cultural community (I wish!), I like to post especially edgy and esoteric material to Overlord In Terms of Core Issues Around Maximal Engagement with Key Notions of the Über-Feral on the 23rd of each month. And today I may be posting the especially edgiest and esoterickest material ever dot dot dot

After all, this entry at the Online Encyclopedia of Integer Sequences is about numbers that are palindromes in two particularly pertinent bases:

A060792 Numbers that are palindromic in bases 2 and 3.

0, 1, 6643, 1422773, 5415589, 90396755477, 381920985378904469, 1922624336133018996235, 2004595370006815987563563, 8022581057533823761829436662099, 392629621582222667733213907054116073, 32456836304775204439912231201966254787, 428027336071597254024922793107218595973 (A060792 at OEIS, with more entries)


And here are the underlying palindromes:

0: 0 ↔ 0
1: 1 ↔ 1
6643: 1100111110011 ↔ 100010001
1422773: 101011011010110110101 ↔ 2200021200022
5415589: 10100101010001010100101 ↔ 101012010210101
90396755477: 1010100001100000100010000011000010101 ↔ 22122022220102222022122
381920985378904469: 10101001100110110110001110011011001110001101101100110010101 ↔ 2112200222001222121212221002220022112
1922624336133018996235: 11010000011100111000101110001110011011001110001110100011100111000001011 ↔
122120102102011212112010211212110201201021221
2004595370006815987563563: 110101000011111010101010100101111011110111011110111101001010101010111110000101011 ↔ 221010112100202002120002212200021200202001211010122
8022581057533823761829436662099: 1100101010000100101101110000011011011111111011000011100001101111111101101100000111011010010000101010011 ↔ 21000020210011222122220212010000100001021202222122211001202000012
392629621582222667733213907054116073: 10010111001111000100010100010100000011011011000101011011100000111011010100011011011000000101000101000100011110011101001 ↔ 122102120011102000101101000002010021111120010200000101101000201110021201221
32456836304775204439912231201966254787: 11000011010101111010110010100010010011011010101001101000001000100010000010110010101011011001001000101001101011110101011000011 ↔ 1222100201002211120110022121002012121101011212102001212200110211122001020012221
428027336071597254024922793107218595973: 101000010000000110001000011111100101011110011100001110100011100010001110001011100001110011110101001111110000100011000000010000101 ↔ 222001200110022102121001000200200202022111220202002002000100121201220011002100222

Binary Babushkas

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:


101100 ← 1
101100 ← 10
101100 ← 11
101100 ← 100
101100 ← 101

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


10011101000 ← 1 (n=1)
10011101000 ← 10 (n=2)
10011101000 ← 11 (n=3)
10011101000 ← 100 (n=4)
10011101000 ← 101 (n=5)
10011101000 ← 110 (n=6)
10011101000 ← 111 (n=7)
10011101000 ← 1000 (n=8)
10011101000 ← 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:


100011001010011101011011110000 ← 1 (n=1)
100011001010011101011011110000 ← 10 (n=2)
100011001010011101011011110000 ← 11 (n=3)
100011001010011101011011110000 ← 100 (n=4)
100011001010011101011011110000 ← 101 (n=5)
100011001010011101011011110000 ← 110 (n=6)
100011001010011101011011110000 ← 111 (n=7)
100011001010011101011011110000 ← 1000 (n=8)
100011001010011101011011110000 ← 1001 (n=9)
100011001010011101011011110000 ← 1010 (n=10)
100011001010011101011011110000 ← 1011 (n=11)
100011001010011101011011110000 ← 1100 (n=12)
100011001010011101011011110000 ← 1101 (n=13)
100011001010011101011011110000 ← 1110 (n=14)
100011001010011101011011110000 ← 1111 (n=15)
100011001010011101011011110000 ← 10000 (n=16)
100011001010011101011011110000 ← 10001 (n=17)
100011001010011101011011110000 ← 10010 (n=18)
100011001010011101011011110000 ← 10011 (n=19)
100011001010011101011011110000 ← 10100 (n=20)
100011001010011101011011110000 ← 10101 (n=21)
100011001010011101011011110000 ← 10110 (n=22)
100011001010011101011011110000 ← 10111 (n=23)
100011001010011101011011110000 ← 11000 (n=24)
100011001010011101011011110000 ← 11001 (n=25)
100011001010011101011011110000 ← 11010 (n=26)
100011001010011101011011110000 ← 11011 (n=27)
100011001010011101011011110000 ← 11100 (n=28)
100011001010011101011011110000 ← 11101 (n=29)
100011001010011101011011110000 ← 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.