Primal Pellicles

Numbers have thin skins. And they’re easily replaced. Take 71624133. Here it is permuting its pellicles:

71624133 in base 10 = 100010001001110010111000101 in base 2 = 11222202212211200 in b3 = 10101032113011 in b4 = 121313433013 in b5 = 11035053113 in b6 = 1526536500 in b7 = 421162705 in b8 = 158685750 in b9 = 374802A9 in b11 = 1BBA1199 in b12 = 11AB9B59 in b13 = 9726137 in b14 = 644BE73 in b15 = F3855B7 in b16

But if digits are the skin of 71624133, what are its bones? Well, you could say the skeleton of a number, something that doesn’t change from base to base, is its prime factorization:

71624133 = 32 × 72 × 162413

But the primes themselves are numbers, so they’re wearing pellicles too. And it turns out that, in base 10, the pellicles of the prime factors of 71624133 match the pellicle of 71624133 itself:

71624133 = 32.72.162413

Here’s a list of primal pellicles in base 10:

735 = 3.5.72
3792 = 24.3.79
1341275 = 52.13.4127
13115375 = 53.7.13.1153
22940075 = 52.229.4007
29373375 = 3.53.29.37.73
71624133 = 32.72.162413
311997175 = 52.7.172.31.199
319953792 = 27.3.53.79.199
1019127375 = 32.53.7.127.1019
1147983375 = 3.53.7.11.83.479
1734009275 = 52.173.400927
5581625072 = 24.5581.62507
7350032375 = 53.7.23.73.5003
17370159615 = 34.5.17.59.61.701
33061224492 = 22.33.306122449
103375535837 = 72.37.103.553583
171167303912 = 23.11.172.6730391
319383665913 = 3.133.19.383.6659
533671737975 = 34.52.17.53.367.797
2118067737975 = 32.52.7.79.211.80677
3111368374257 = 3.112.132.683.74257
3216177757191 = 3.73.191.757.21617
3740437158475 = 52.37.4043715847
3977292332775 = 3.52.292.233.277.977
4417149692375 = 53.7.23.4969.44171
7459655393232 = 24.32.72.23.45965539
7699132721175 = 3.52.72.27211.76991
7973529228735 = 3.5.7.972.2287.3529
10771673522535 = 34.5.67.71.107.52253

You can find them at the Online Encyclopedia of Integer Sequences under A121342, “Composite numbers that are a concatenation of their distinct prime divisors in some order.” But what about pairs of primal pellicles, that is, pairs of numbers where the prime factors of each form the pellicle of the other?

35 = 5.775 = 3.52
1275 = 3.52.173175 = 52.127
131715 = 32.5.2927329275 = 52.13171
3199767 = 3.359.297135932971 = 3.19.67.972
14931092 = 22.11.61.5563116155632 = 24.3.109.1492

And here are a few primal pellicles I’ve found in other bases:

Primal Pellicles in Base 2

1111011011110 = 10.1110.110110111 in b2 = 7902 = 2.32.439 in b10
1110001100110111 = 1110.10111.100011001 in b2 = 58167 = 32.23.281 in b10
1111011011011110 = 10.1110.110110110111 in b2 = 63198 = 2.32.3511 in b10
11101001100001101 = 1110.101.101001100001 in b2 = 119565 = 32.5.2657 in b10
1111011011011011110 = 10.1110.110110110110111 in b2 = 505566 = 2.32.28087 in b10
1111011111101111011 = 1110.1011.10111.11011111 in b2 = 507771 = 32.11.23.223 in b10


Primal Pellicles in Base 3

121022 = 210.12.102 in b3 = 440 = 23.5.11 in b10
212212 = 22.21.212 in b3 = 644 = 22.7.23 in b10
20110112 = 210.201.1011 in b3 = 4712 = 23.19.31 in b10
21110110 = 10.212.1101 in b3 = 5439 = 3.72.37 in b10
121111101 = 122.111.1101 in b3 = 12025 = 52.13.37 in b10
222112121 = 22.21.221121 in b3 = 19348 = 22.7.691 in b10
2202122021 = 22.2021.22021 in b3 = 54412 = 22.61.223 in b10
120212201221 = 2.122.21.201.1202 in b3 = 312550 = 2.52.7.19.47 in b10


Primal Pellicles in Base 7

2525 = 2.52.25 in b7 = 950 = 2.52.19 in b10
3210 = 2.34.10 in b7 = 1134 = 2.34.7 in b10
5252 = 2.52.52 in b7 = 1850 = 2.52.37 in b10
332616 = 33.16.326 in b7 = 58617 = 33.13.167 in b10
336045 = 32.5.3604 in b7 = 59715 = 32.5.1327 in b10
2251635 = 22.3.5.16.252 in b7 = 281580 = 22.3.5.13.192 in b10


Primal Pellicles in Base 11

253 = 22.3.52 in b11 = 300 = 22.3.52 in b10
732 = 2.32.72 in b11 = 882 = 2.32.72 in b10
2123 = 23.33.12 in b11 = 2808 = 23.33.13 in b10
3432 = 25.3.43 in b11 = 4512 = 25.3.47 in b10
3710 = 32.72.10 in b11 = 4851 = 32.72.11 in b10
72252 = 23.72.225 in b11 = 105448 = 23.72.269 in b10


Primal Pellicles in Base 15

275 = 24.5.7 in b15 = 560 = 24.5.7 in b10
2D5 = 2.52.D in b15 = 650 = 2.52.13 in b10
2CD5 = 2.52.CD in b15 = 9650 = 2.52.193 in b10
7BE3 = 3.72.BE in b15 = 26313 = 3.72.179 in b10
21285 = 24.52.128 in b15 = 105200 = 24.52.263 in b10

Fine as Nine

This is a regular nonagon (a polygon with nine sides):

A nonagon or enneagon (from Wikipedia)

And this is the endlessly repeating decimal of the reciprocal of 7:

1/7 = 0.142857142857142857142857…

What is the curious connection between 1/7 and nonagons? If I’d been asked that a week ago, I’d’ve had no answer. Then I found a curious connection when I was looking at the leading digits of polygonal numbers. A polygonal number is a number that can be represented in the form of a polygon. Triangular numbers look like this:


* = 1

*
** = 3

*
**
*** = 6

*
**
***
**** = 10

*
**
***
****
***** = 15

By looking at the shapes rather than the numbers, it’s easy to see that you generate the triangular numbers by simply summing the integers:


1 = 1
1+2=3
1+2+3=6
1+2+3+4=10
1+2+3+4+5=15

Now try the square numbers:


* = 1

**
** = 4

***
***
*** = 9

****
****
****
**** = 16

*****
*****
*****
*****
***** = 25


You generate the square numbers by summing the odd integers:


1 = 1
1+3 = 4
1+3+5 = 9
1+3+7 = 16
1+3+7+9 = 25

Next come the pentagonal numbers, the hexagonal numbers, the heptagonal numbers, and so on. I was looking at the leading digits of these numbers and trying to find patterns. For example, when do the leading digits of the k-th triangular number, tri(k), match the digits of k? This is when:


tri(1) = 1
tri(19) = 190
tri(199) = 19900
tri(1999) = 1999000
tri(19999) = 199990000
tri(199999) = 19999900000
[...]

That pattern is easy to explain. The formula for the k-th polygonal number is k * ((pn-2)*k + (4-pn)) / 2, where pn = 3 for the triangular numbers, 4 for the square numbers, 5 for the pentagonal numbers, and so on. Therefore the k-th triangular number is k * (k + 1) / 2. When k = 19, the formula is 19 * (19 + 1) / 2 = 19 * 20 / 2 = 19 * 10 = 190. And so on. Now try the pol(k) = leaddig(pol(k)) for higher polygonal numbers. The patterns are easy to predict until you get to the nonagonal numbers:


square(10) = 100
square(100) = 10000
square(1000) = 1000000
square(10000) = 100000000
square(100000) = 10000000000
[...]


pentagonal(7) = 70
pentagonal(67) = 6700
pentagonal(667) = 667000
pentagonal(6667) = 66670000
pentagonal(66667) = 6666700000
[...]


hexagonal(6) = 66
hexagonal(51) = 5151
hexagonal(501) = 501501
hexagonal(5001) = 50015001
hexagonal(50001) = 5000150001
[...]


heptagonal(5) = 55
heptagonal(41) = 4141
heptagonal(401) = 401401
heptagonal(4001) = 40014001
heptagonal(40001) = 4000140001
[...]


octagonal(4) = 40
octagonal(34) = 3400
octagonal(334) = 334000
octagonal(3334) = 33340000
octagonal(33334) = 3333400000
[...]


nonagonal(4) = 46
nonagonal(30) = 3075
nonagonal(287) = 287574
nonagonal(2858) = 28581429
nonagonal(28573) = 2857385719
nonagonal(285715) = 285715000000
nonagonal(2857144) = 28571444285716
nonagonal(28571430) = 2857143071428575
nonagonal(285714287) = 285714287571428574
nonagonal(2857142858) = 28571428581428571429
nonagonal(28571428573) = 2857142857385714285719
nonagonal(285714285715) = 285714285715000000000000
nonagonal(2857142857144) = 28571428571444285714285716
nonagonal(28571428571430) = 2857142857143071428571428575
nonagonal(285714285714287) = 285714285714287571428571428574
nonagonal(2857142857142858) = 28571428571428581428571428571429
nonagonal(28571428571428573) = 2857142857142857385714285714285719
nonagonal(285714285714285715) = 285714285714285715000000000000000000
nonagonal(2857142857142857144) = 28571428571428571444285714285714285716
nonagonal(28571428571428571430) = 2857142857142857143071428571428571428575
[...]


What’s going on with the leading digits of the nonagonals? Well, they’re generating a different reciprocal. Or rather, they’re generating the multiple of a different reciprocal:


1/7 * 2 = 2/7 = 0.285714285714285714285714285714...

And why does 1/7 have this curious connection with the nonagonal numbers? Because the nonagonal formula is k * (7k-5) / 2 = k * ((9-2) * k + (4-pn)) / 2. Now look at the pentadecagonal numbers, where pn = 15:


pentadecagonal(1538461538461538461540) = 15384615384615384615406923076923076923076930

2/13 = 0.153846153846153846153846153846...

pentadecagonal formula = k * (13k - 11) / 2 = k * ((15-2)*k + (4-15)) / 2

Penultimately, let’s look at the icosikaihenagonal numbers, where pn = 21:


icosikaihenagonal(2) = 21
icosikaihenagonal(12) = 1266
icosikaihenagonal(107) = 107856
icosikaihenagonal(1054) = 10544743
icosikaihenagonal(10528) = 1052878960
icosikaihenagonal(105265) = 105265947385
icosikaihenagonal(1052633) = 10526335263165
icosikaihenagonal(10526317) = 1052631731578951
icosikaihenagonal(105263159) = 105263159210526318
icosikaihenagonal(1052631580) = 10526315801578947370
icosikaihenagonal(10526315791) = 1052631579163157894746
icosikaihenagonal(105263157896) = 105263157896368421052636
icosikaihenagonal(1052631578949) = 10526315789497368421052643
icosikaihenagonal(10526315789475) = 1052631578947542105263157900
icosikaihenagonal(105263157894738) = 105263157894738263157894736845
icosikaihenagonal(1052631578947370) = 10526315789473706842105263157905
icosikaihenagonal(10526315789473686) = 1052631578947368689473684210526331
icosikaihenagonal(105263157894736843) = 105263157894736843000000000000000000
icosikaihenagonal(1052631578947368422) = 10526315789473684220526315789473684211
icosikaihenagonal(10526315789473684212) = 1052631578947368421257894736842105263166

2/19 = 0.1052631578947368421052631579

icosikaihenagonal formula = k * (19k - 17) / 2 = k * ((21-2)*k + (4-21)) / 2

And ultimately, let’s look at this other pattern in the leading digits of the triangular numbers, which I can’t yet explain at all:


tri(904) = 409060
tri(6191) = 19167336
tri(98984) = 4898965620
tri(996694) = 496699963165
tri(9989894) = 49898996060565
tri(99966994) = 4996699994681515
tri(999898994) = 499898999601055515
tri(9999669994) = 49996699999451815015
tri(99998989994) = 4999898999960055555015
tri(999996699994) = 499996699999945018150015
tri(9999989899994) = 49999898999996005055550015
tri(99999966999994) = 4999996699999994500181500015
tri(999999898999994) = 499999898999999600500555500015
[...]

Two be Continued…

Here’s a useless fact that nobody interested in mathematics would ever forget: digsum(fib(2222)) = 2222. That is, if you add the digits of the 2222nd Fibonacci number, you get 2222:


fib(2222) = 104,966,721,620,282,584,734,867,037,988,863,914,269,721,309,244,628,258,918,225,835,217,264,239,539,186,480,867,849,267,122,885,365,019,934,494,625,410,255,045,832,359,715,759,649,385,824,745,506,982,513,773,397,742,803,445,080,995,617,047,976,796,168,678,756,479,470,761,439,513,575,962,955,568,645,505,845,492,393,360,201,582,183,610,207,447,528,637,825,187,188,815,786,270,477,935,419,631,184,553,635,981,047,057,037,341,800,837,414,913,595,584,426,355,208,257,232,868,908,837,817,478,483,039,310,790,967,631,454,123,105,472,742,221,897,397,857,677,674,619,381,961,429,837,434,434,636,098,678,708,225,493,682,469,561

2222 = 1 + 0 + 4 + 9 + 6 + 6 + 7 + 2 + 1 + 6 + 2 + 0 + 2 + 8 + 2 + 5 + 8 + 4 + 7 + 3 + 4 + 8 + 6 + 7 + 0 + 3 + 7 + 9 + 8 + 8 + 8 + 6 + 3 + 9 + 1 + 4 + 2 + 6 + 9 + 7 + 2 + 1 + 3 + 0 + 9 + 2 + 4 + 4 + 6 + 2 + 8 + 2 + 5 + 8 + 9 + 1 + 8 + 2 + 2 + 5 + 8 + 3 + 5 + 2 + 1 + 7 + 2 + 6 + 4 + 2 + 3 + 9 + 5 + 3 + 9 + 1 + 8 + 6 + 4 + 8 + 0 + 8 + 6 + 7 + 8 + 4 + 9 + 2 + 6 + 7 + 1 + 2 + 2 + 8 + 8 + 5 + 3 + 6 + 5 + 0 + 1 + 9 + 9 + 3 + 4 + 4 + 9 + 4 + 6 + 2 + 5 + 4 + 1 + 0 + 2 + 5 + 5 + 0 + 4 + 5 + 8 + 3 + 2 + 3 + 5 + 9 + 7 + 1 + 5 + 7 + 5 + 9 + 6 + 4 + 9 + 3 + 8 + 5 + 8 + 2 + 4 + 7 + 4 + 5 + 5 + 0 + 6 + 9 + 8 + 2 + 5 + 1 + 3 + 7 + 7 + 3 + 3 + 9 + 7 + 7 + 4 + 2 + 8 + 0 + 3 + 4 + 4 + 5 + 0 + 8 + 0 + 9 + 9 + 5 + 6 + 1 + 7 + 0 + 4 + 7 + 9 + 7 + 6 + 7 + 9 + 6 + 1 + 6 + 8 + 6 + 7 + 8 + 7 + 5 + 6 + 4 + 7 + 9 + 4 + 7 + 0 + 7 + 6 + 1 + 4 + 3 + 9 + 5 + 1 + 3 + 5 + 7 + 5 + 9 + 6 + 2 + 9 + 5 + 5 + 5 + 6 + 8 + 6 + 4 + 5 + 5 + 0 + 5 + 8 + 4 + 5 + 4 + 9 + 2 + 3 + 9 + 3 + 3 + 6 + 0 + 2 + 0 + 1 + 5 + 8 + 2 + 1 + 8 + 3 + 6 + 1 + 0 + 2 + 0 + 7 + 4 + 4 + 7 + 5 + 2 + 8 + 6 + 3 + 7 + 8 + 2 + 5 + 1 + 8 + 7 + 1 + 8 + 8 + 8 + 1 + 5 + 7 + 8 + 6 + 2 + 7 + 0 + 4 + 7 + 7 + 9 + 3 + 5 + 4 + 1 + 9 + 6 + 3 + 1 + 1 + 8 + 4 + 5 + 5 + 3 + 6 + 3 + 5 + 9 + 8 + 1 + 0 + 4 + 7 + 0 + 5 + 7 + 0 + 3 + 7 + 3 + 4 + 1 + 8 + 0 + 0 + 8 + 3 + 7 + 4 + 1 + 4 + 9 + 1 + 3 + 5 + 9 + 5 + 5 + 8 + 4 + 4 + 2 + 6 + 3 + 5 + 5 + 2 + 0 + 8 + 2 + 5 + 7 + 2 + 3 + 2 + 8 + 6 + 8 + 9 + 0 + 8 + 8 + 3 + 7 + 8 + 1 + 7 + 4 + 7 + 8 + 4 + 8 + 3 + 0 + 3 + 9 + 3 + 1 + 0 + 7 + 9 + 0 + 9 + 6 + 7 + 6 + 3 + 1 + 4 + 5 + 4 + 1 + 2 + 3 + 1 + 0 + 5 + 4 + 7 + 2 + 7 + 4 + 2 + 2 + 2 + 1 + 8 + 9 + 7 + 3 + 9 + 7 + 8 + 5 + 7 + 6 + 7 + 7 + 6 + 7 + 4 + 6 + 1 + 9 + 3 + 8 + 1 + 9 + 6 + 1 + 4 + 2 + 9 + 8 + 3 + 7 + 4 + 3 + 4 + 4 + 3 + 4 + 6 + 3 + 6 + 0 + 9 + 8 + 6 + 7 + 8 + 7 + 0 + 8 + 2 + 2 + 5 + 4 + 9 + 3 + 6 + 8 + 2 + 4 + 6 + 9 + 5 + 6 + 1

Numbers like this, where k = digsum(fib(k)), are rare. And 2222 is almost certainly the last of them. These are the relevant listings at the Online Encyclopedia of Integer Sequences:


0, 1, 5, 10, 31, 35, 62, 72, 175, 180, 216, 251, 252, 360, 494, 504, 540, 946, 1188, 2222 — A020995, Numbers k such that the sum of the digits of Fibonacci(k) is k.

0, 1, 5, 55, 1346269, 9227465, 4052739537881, 498454011879264, 1672445759041379840132227567949787325, 18547707689471986212190138521399707760, 619220451666590135228675387863297874269396512... — A067515, Fibonacci numbers with index = digit sum.

At least, they’re rare in base 10. What about other bases? Well, they’re rare in all other bases except one: base 11. When I looked there, I quickly found more than 450 numbers where digsum(fib(k),b=11) = k. So here’s an interesting little problem: Why is base 11 so productive? Or maybe I should say: Φ is base 11 so productive?

Wake the Snake

In my story “Kopfwurmkundalini”, I imagined the square root of 2 as an infinitely long worm or snake whose endlessly varying digit-segments contained all stories ever (and never) written:

• √2 = 1·414213562373095048801688724209698078569671875376948073…

But there’s another way to get all stories ever written from the number 2. You don’t look at the root(s) of 2, but at the powers of 2:

• 2 = 2^1 = 2
• 4 = 2^2 = 2*2
• 8 = 2^3 = 2*2*2
• 16 = 2^4 = 2*2*2*2
• 32 = 2^5 = 2*2*2*2*2
• 64 = 2^6 = 2*2*2*2*2*2
• 128 = 2^7 = 2*2*2*2*2*2*2
• 256 = 2^8 = 2*2*2*2*2*2*2*2
• 512 = 2^9 = 2*2*2*2*2*2*2*2*2
• 1024 = 2^10
• 2048 = 2^11
• 4096 = 2^12
• 8192 = 2^13
• 16384 = 2^14
• 32768 = 2^15
• 65536 = 2^16
• 131072 = 2^17
• 262144 = 2^18
• 524288 = 2^19
• 1048576 = 2^20
• 2097152 = 2^21
• 4194304 = 2^22
• 8388608 = 2^23
• 16777216 = 2^24
• 33554432 = 2^25
• 67108864 = 2^26
• 134217728 = 2^27
• 268435456 = 2^28
• 536870912 = 2^29
• 1073741824 = 2^30
[...]

The powers of 2 are like an ever-lengthening snake swimming across a pool. The snake has an endlessly mutating head and a rhythmically waving tail with a regular but ever-more complex wake. That is, the leading digits of 2^p don’t repeat but the trailing digits do. Look at the single final digit of 2^p, for example:

• 02 = 2^1
• 04 = 2^2
• 08 = 2^3
• 16 = 2^4
• 32 = 2^5
• 64 = 2^6
• 128 = 2^7
• 256 = 2^8
• 512 = 2^9
• 1024 = 2^10
• 2048 = 2^11
• 4096 = 2^12
• 8192 = 2^13
• 16384 = 2^14
• 32768 = 2^15
• 65536 = 2^16
• 131072 = 2^17
• 262144 = 2^18
• 524288 = 2^19
• 1048576 = 2^20
• 2097152 = 2^21
• 4194304 = 2^22
[...]

The final digit of 2^p falls into a loop: 2 → 4 → 8 → 6 → 2 → 4→ 8…

Now try the final two digits of 2^p:

02 = 2^1
04 = 2^2
08 = 2^3
16 = 2^4
32 = 2^5
64 = 2^6
• 128 = 2^7
• 256 = 2^8
• 512 = 2^9
• 1024 = 2^10
• 2048 = 2^11
• 4096 = 2^12
• 8192 = 2^13
• 16384 = 2^14
• 32768 = 2^15
• 65536 = 2^16
• 131072 = 2^17
• 262144 = 2^18
• 524288 = 2^19
• 1048576 = 2^20
• 2097152 = 2^21
• 4194304 = 2^22
• 8388608 = 2^23
• 16777216 = 2^24
• 33554432 = 2^25
• 67108864 = 2^26
• 134217728 = 2^27
• 268435456 = 2^28
• 536870912 = 2^29
• 1073741824 = 2^30
[...]

Now there’s a longer loop: 02 → 04 → 08 → 16 → 32 → 64 → 28 → 56 → 12 → 24 → 48 → 96 → 92 → 84 → 68 → 36 → 72 → 44 → 88 → 76 → 52 → 04 → 08 → 16 → 32 → 64 → 28… Any number of trailing digits, 1 or 2 or one trillion, falls into a loop. It just takes longer as the number of trailing digits increases.

That’s the tail of the snake. At the other end, the head of the snake, the digits don’t fall into a loop (because of the carries from the lower digits). So, while you can get only 2, 4, 8 and 6 as the final digits of 2^p, you can get any digit but 0 as the first digit of 2^p. Indeed, I conjecture (but can’t prove) that not only will all integers eventually appear as the leading digits of 2^p, but they will do so infinitely often. Think of a number and it will appear as the leading digits of 2^p. Let’s try the numbers 1, 12, 123, 1234, 12345…:

16 = 2^4
128 = 2^7
12379400392853802748... = 2^90
12340799625835686853... = 2^1545
12345257952011458590... = 2^34555
12345695478410965346... = 2^63293
12345673811591269861... = 2^4869721
12345678260232358911... = 2^5194868
12345678999199154389... = 2^62759188

But what about the numbers 9, 98, 987, 986, 98765… as leading digits of 2^p? They don’t appear as quickly:

9007199254740992 = 2^53
98079714615416886934... = 2^186
98726397006685494828... = 2^1548
98768356967522174395... = 2^21257
98765563827287722773... = 2^63296
98765426081858871289... = 2^5194871
98765430693066680199... = 2^11627034
98765432584491513519... = 2^260855656
98765432109571471006... = 2^1641098748

Why do fragments of 123456789 appear much sooner than fragments of 987654321? Well, even though all integers occur infinitely often as leading digits of 2^p, some integers occur more often than others, as it were. The leading digits of 2^p are actually governed by a fascinating mathematical phenomenon known as Benford’s law, which states, for example, that the single first digit, d, will occur with the frequency log10(1 + 1/d). Here are the actual frequencies of 1..9 for all powers of 2 up to 2^101000, compared with the estimate by Benford’s law:

1: 30% of leading digits ↔ 30.1% estimated
2: 17.55% ↔ 17.6%
3: 12.45% ↔ 12.49%
4: 09.65% ↔ 9.69%
5: 07.89% ↔ 7.92%
6: 06.67% ↔ 6.69%
7: 05.77% ↔ 5.79%
8: 05.09% ↔ 5.11%
9: 04.56% ↔ 4.57%

Because (inter alia) 1 appears as the first digit of 2^p far more often than 9 does, the fragments of 123456789 appear faster than the fragments of 987654321. Mutatis mutandis, the same applies in all other bases (apart from bases that are powers of 2, where there’s a single leading digit, 1, 2, 4, 8…, followed by 0s). But although a number like 123456789 occurs much frequently than 987654321 in 2^p expressed in base 10 (and higher), both integers occur infinitely often.

As do all other integers. And because stories can be expressed as numbers, all stories ever (and never) written appear in the powers of 2. Infinitely often. You’ll just have to trim the tail of the story-snake.

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

The Trivial Troot

Here is the square root of 2:

√2 = 1·414213562373095048801688724209698078569671875376948073176679738...

Here is the square root of 20:

√20 = 4·472135954999579392818347337462552470881236719223051448541794491...

And here are the first few triangular numbers:

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...

What links √2 and √20 strongly with the triangular numbers? At first glance, nothing does. The square roots of 2 and 20 are very different from the triangular numbers. Square roots like those are irrational, that is, they can’t be represented as a fraction or ratio of integers. This means that their digits go on for ever, never falling into a regular pattern. So the digits are hard to calculate. The sequence of triangular numbers also goes on for ever, but it’s very easy to calculate. The triangular numbers get their name from the way they can be arranged into simple triangles, like this:

* = 1


*
** = 3


*
**
*** = 6


*
**
***
**** = 10


*
**
***
****
***** = 15

The 1st triangular number is 1, the 2nd is 3 = 1+2, the 3rd is 6 = 1+2+3, the 4th is 10 = 1+2+3+4, and so on. The n-th triangular number = 1+2+3…+n, so the formula for the n-th triangular number is n*(n+1)/2 = (n^2+n)/2. So what’s the 123456789th triangular number? Easy: it’s 7620789436823655 (see A077694 at the OEIS). But what’s the 123456789th digit of √2 or √20? That’s not easy to answer. But here’s something else that is easy to answer. If tri(n) is the n-th triangular number, what are the values of n when tri(n) is one digit longer than tri(n-1)? That is, what are the values of n when tri(n) increases in length by one digit? If you look at the beginning of the sequence, you can see the first three answers:

1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66, 78, 91, 105...

1 is one digit longer than nothing, as it were, and 1 = tri(1); 10 is one digit longer than 6 and 10 = tri(4); 105 is one digit longer than 91 and 105 = tri(14). Here are some more answers, giving triangular numbers on the left, as they increase in length by one digit, and the n of tri(n) on the right:

1 ← 1
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
1000000042485480 ← 44721360
10000000037150046 ← 141421356
100000000000018810 ← 447213595
1000000000179470703 ← 1414213562
10000000002237948990 ← 4472135955
100000000010876002500 ← 14142135624
1000000000022548781025 ← 44721359550
10000000000026940078203 ← 141421356237
100000000000242416922750 ← 447213595500
1000000000000572687476751 ← 1414213562373
10000000000004117080477500 ← 4472135955000
100000000000007771272992046 ← 14142135623731
1000000000000031576491575006 ← 44721359549996
10000000000000140731196136705 ← 141421356237310
100000000000000250760786750861 ← 447213595499958
1000000000000000638090771126060 ← 1414213562373095
10000000000000000479330922588410 ← 4472135954999579
100000000000000000169466805816725 ← 14142135623730950
1000000000000000025572412483843115 ← 44721359549995794
10000000000000000087657358700327265 ← 141421356237309505
100000000000000000097566473134542830 ← 447213595499957939
1000000000000000000987561276980703725 ← 1414213562373095049
10000000000000000003048443380954913921 ← 4472135954999579393
100000000000000000006832246143819194316 ← 14142135623730950488
1000000000000000000014155501020518731556 ← 44721359549995793928

Can you spot the patterns? When tri(n) has an odd number of digits, n approximates the digits of √2; when tri(n) has an even number of digits, n approximates the digits of √20. And what can you call the approximations? Well, in a way they’re triangular roots so I’m calling them troots. Here are the troots for tri(n) with an odd number of digits:

1 → 1
14 → 105
141 → 10011
1414 → 1000405
14142 → 100005153
141421 → 10000020331
1414214 → 1000001326005
14142136 → 100000012392316
141421356 → 10000000037150046
1414213562 → 1000000000179470703
14142135624 → 100000000010876002500
141421356237 → 10000000000026940078203
1414213562373 → 1000000000000572687476751
14142135623731 → 100000000000007771272992046
141421356237310 → 10000000000000140731196136705
1414213562373095 → 1000000000000000638090771126060
14142135623730950 → 100000000000000000169466805816725
141421356237309505 → 10000000000000000087657358700327265
1414213562373095049 → 1000000000000000000987561276980703725
14142135623730950488 → 100000000000000000006832246143819194316
14142135623730950488... = √2 (without the decimal point)

When I first found these patterns, I thought I might have discovered something mathematically profound. I hadn’t. Troots are trivial. I think troots are beautiful too, but a little thought soon showed me how easily and obviously they arise. Remember that the formula for tri(n), the n-th triangular number, is tri(n) = (n^2+n)/2. As you can see above, when tri(n) is increasing in length by one digit, it rises above the next power of 10, which always begins with 1 followed by only 0s. Therefore n^2+n will begin with the digit 2 followed by some 0s, which then becomes 1 followed by some 0s as (n^2+n) is divided by 2. So n for tri(n) increasing-by-one-digit will be the first integer, n, where n^2+n yields a number with 2 as the leading digit followed by more and more 0s.

And that’s why n approximates the digits of √2·0000… and √20·0000…, for tri(n) with an odd and even number of digits, respectively. Similar trootful patterns exist in other bases and for other polygonal numbers, like the square numbers, the pentagonal numbers and so on. The troots are beautiful to see but trivial to explain. All the same, there is a sense in which you can say the mindless sequence of triangular numbers is “calculating” the digits of √2 and √20. It even rounds up the final digits when necessary:

1414214 → 1000001326005
14142136 → 100000012392316
141421356 → 10000000037150046
141421356... = √2
[...]
14142135624 → 100000000010876002500
141421356237 → 10000000000026940078203
141421356237... = √2
[...]
14142135623731 → 100000000000007771272992046
141421356237310 → 10000000000000140731196136705
1414213562373095 → 1000000000000000638090771126060
1414213562373095... = √2
[...]
1414213562373095049 → 1000000000000000000987561276980703725
14142135623730950488 → 100000000000000000006832246143819194316
14142135623730950488... = √2

Fib and Let Tri

It’s a simple sequence with hidden depths:

1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765, 10946, 17711, 28657, 46368, 75025, 121393, 196418, 317811, 514229, 832040, 1346269, 2178309, 3524578, 5702887, 9227465, 14930352, 24157817, 39088169, 63245986, 102334155... — A000045 at OEIS

That’s the Fibonacci sequence, probably the most famous of all integer sequences after the integers themselves (1, 2, 3, 4, 5…) and the primes (2, 3, 5, 7, 11…). It has a very simple definition: if fib(fi) is the fi-th number in the Fibonacci sequence, then fib(fi) = fib(fi-1) + fib(fi-2). By definition, fib(1) = fib(2) = 1. After that, it’s easy to generate new numbers:

2 = fib(3) = fib(1) + fib(2) = 1 + 1
3 = fib(4) = fib(2) + fib(3) = 1 + 2
5 = fib(5) = fib(3) + fib(4) = 2 + 3
8 = fib(6) = fib(4) + fib(5) = 3 + 5
13 = fib(7) = fib(5) + fib(6) = 5 + 8
21 = fib(8) = fib(6) + fib(7) = 8 + 13
34 = fib(9) = fib(7) + fib(8) = 13 + 21
55 = fib(10) = fib(8) + fib(9) = 21 + 34
89 = fib(11) = fib(9) + fib(10) = 34 + 55
144 = fib(12) = fib(10) + fib(11) = 55 + 89
233 = fib(13) = fib(11) + fib(12) = 89 + 144
377 = fib(14) = fib(12) + fib(13) = 144 + 233
610 = fib(15) = fib(13) + fib(14) = 233 + 377
987 = fib(16) = fib(14) + fib(15) = 377 + 610
[...]

How to create the Fibonacci sequence is obvious. But it’s not obvious that fib(fi) / fib(fi-1) gives you ever-better approximations to a fascinating constant called φ, the golden ratio, which is 1.618033988749894…:

1/1 = 1
2/1 = 2
3/2 = 1.5
5/3 = 1.66666...
8/5 = 1.6
13/8 = 1.625
21/13 = 1.615384...
34/21 = 1.619047...
55/34 = 1.6176470588235294117647058823...
89/55 = 1.618181818...
144/89 = 1.617977528089887640...
233/144 = 1.6180555555...
377/233 = 1.618025751072961...
610/377 = 1.618037135278514...
987/610 = 1.618032786885245...
[...]

And that’s just the start of the hidden depths in the Fibonacci sequence. I stumbled across another interesting pattern for myself a few days ago. I was looking at the sequence and one of the numbers caught my eye:

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

55 is a palindrome, reading the same forward and backwards. I wondered whether there were any other palindromes in the sequence (apart from the trivial single-digit palindromes 1, 1, 2, 3…). I couldn’t find any more. Nor can anyone else, apparently. But that’s in base 10. Other bases are more productive. For example, in bases 2, 3 and 4, you get this:

11 in b2 = 3
101 in b2 = 5
10101 in b2 = 21


22 in b3 = 8
111 in b3 = 13
22122 in b3 = 233


11 in b4 = 5
111 in b4 = 21
202 in b4 = 34
313 in b4 = 55


I decided to concentrate on tripals, or palindromes with three digits. I started looking at bases that set records for the greatest number of tripals. And there are some interesting patterns in the digits of the tripals in these bases (when a digit > 9, the digit is represented inside square brackets — see base-29 and higher). See how quickly you can spot the patterns:

Palindromic Fibonacci numbers in base-4

111 in b4 (fib=21, fi=8)
202 in b4 (fib=34, fi=9)
313 in b4 (fib=55, fi=10)

4 = 2^2 (pal=3)


Palindromic Fibonacci numbers in base-11

121 in b11 (fib=144, fi=12)
313 in b11 (fib=377, fi=14)
505 in b11 (fib=610, fi=15)
818 in b11 (fib=987, fi=16)

11 is prime (pal=4)


Palindromic Fibonacci numbers in base-29

151 in b29 (fib=987, fi=16)
323 in b29 (fib=2584, fi=18)
818 in b29 (fib=6765, fi=20)
[13]0[13] in b29 (fib=10946, fi=21)
[21]1[21] in b29 (fib=17711, fi=22)

29 is prime (pal=5)


Palindromic Fibonacci numbers in base-76

1[13]1 in b76 (fib=6765, fi=20)
353 in b76 (fib=17711, fi=22)
828 in b76 (fib=46368, fi=24)
[21]1[21] in b76 (fib=121393, fi=26)
[34]0[34] in b76 (fib=196418, fi=27)
[55]1[55] in b76 (fib=317811, fi=28)

76 = 2^2 * 19 (pal=6)


Palindromic Fibonacci numbers in base-199

1[34]1 in b199 (fib=46368, fi=24)
3[13]3 in b199 (fib=121393, fi=26)
858 in b199 (fib=317811, fi=28)
[21]2[21] in b199 (fib=832040, fi=30)
[55]1[55] in b199 (fib=2178309, fi=32)
[89]0[89] in b199 (fib=3524578, fi=33)
[144]1[144] in b199 (fib=5702887, fi=34)

199 is prime (pal=7)


Palindromic Fibonacci numbers in base-521

1[89]1 in b521 (fib=317811, fi=28)
3[34]3 in b521 (fib=832040, fi=30)
8[13]8 in b521 (fib=2178309, fi=32)
[21]5[21] in b521 (fib=5702887, fi=34)
[55]2[55] in b521 (fib=14930352, fi=36)
[144]1[144] in b521 (fib=39088169, fi=38)
[233]0[233] in b521 (fib=63245986, fi=39)
[377]1[377] in b521 (fib=102334155, fi=40)

521 is prime (pal=8)


Palindromic Fibonacci numbers in base-1364

1[233]1 in b1364 (fib=2178309, fi=32)
3[89]3 in b1364 (fib=5702887, fi=34)
8[34]8 in b1364 (fib=14930352, fi=36)
[21][13][21] in b1364 (fib=39088169, fi=38)
[55]5[55] in b1364 (fib=102334155, fi=40)
[144]2[144] in b1364 (fib=267914296, fi=42)
[377]1[377] in b1364 (fib=701408733, fi=44)
[610]0[610] in b1364 (fib=1134903170, fi=45)
[987]1[987] in b1364 (fib=1836311903, fi=46)

1364 = 2^2 * 11 * 31 (pal=9)


Two patterns are quickly obvious. Every digit in the tripals is a Fibonacci number. And the middle digit of one Fibonacci tripal, fib(fi), becomes fib(fi-2) in the next tripal, while fib(fi), the first and last digits (which are identical), becomes fib(fi+2) in the next tripal.

But what about the bases? If you’re an expert in the Fibonacci sequence, you’ll spot the pattern at work straight away. I’m not an expert, but I spotted it in the end. Here are the first few bases setting records for the numbers of Fibonacci tripals:

4, 11, 29, 76, 199, 521, 1364, 3571, 9349, 24476, 64079, 167761, 439204, 1149851, 3010349, 7881196...

These numbers come from the Lucas sequence, which is closely related to the Fibonacci sequence. But where fib(1) = fib(2) = 1, luc(1) = 1 and luc(2) = 3. After that, luc(li) = luc(li-2) + luc(li-1):

1, 3, 4, 7, 11, 18, 29, 47, 76, 123, 199, 322, 521, 843, 1364, 2207, 3571, 5778, 9349, 15127, 24476, 39603, 64079, 103682, 167761, 271443, 439204, 710647, 1149851, 1860498, 3010349, 4870847, 7881196... — A000204 at OEIS

It seems that every second number from 4 in the Lucas sequence supplies a base in which 1) the number of Fibonacci tripals sets a new record; 2) every digit of the Fibonacci tripals is itself a Fibonacci number.

But can I prove that this is always true? No. And do I understand why these patterns exist? No. My simple search for palindromes in the Fibonacci sequence soon took me far out of my mathematical depth. But it’s been fun to find huge bases like this in which every digit of every Fibonacci tripal is itself a Fibonacci number:

Palindromic Fibonacci numbers in base-817138163596

1[139583862445]1 in b817138163596 (fib=781774079430987230203437, fi=116)
3[53316291173]3 in b817138163596 (fib=2046711111473984623691759, fi=118)
8[20365011074]8 in b817138163596 (fib=5358359254990966640871840, fi=120)
[21][7778742049][21] in b817138163596 (fib=14028366653498915298923761, fi=122)
[55][2971215073][55] in b817138163596 (fib=36726740705505779255899443, fi=124)
[144][1134903170][144] in b817138163596 (fib=96151855463018422468774568, fi=126)
[377][433494437][377] in b817138163596 (fib=251728825683549488150424261, fi=128)
[987][165580141][987] in b817138163596 (fib=659034621587630041982498215, fi=130)
[2584][63245986][2584] in b817138163596 (fib=1725375039079340637797070384, fi=132)
[6765][24157817][6765] in b817138163596 (fib=4517090495650391871408712937, fi=134)
[17711][9227465][17711] in b817138163596 (fib=11825896447871834976429068427, fi=136)
[46368][3524578][46368] in b817138163596 (fib=30960598847965113057878492344, fi=138)
[121393][1346269][121393] in b817138163596 (fib=81055900096023504197206408605, fi=140)
[317811][514229][317811] in b817138163596 (fib=212207101440105399533740733471, fi=142)
[832040][196418][832040] in b817138163596 (fib=555565404224292694404015791808, fi=144)
[2178309][75025][2178309] in b817138163596 (fib=1454489111232772683678306641953, fi=146)
[5702887][28657][5702887] in b817138163596 (fib=3807901929474025356630904134051, fi=148)
[14930352][10946][14930352] in b817138163596 (fib=9969216677189303386214405760200, fi=150)
[39088169][4181][39088169] in b817138163596 (fib=26099748102093884802012313146549, fi=152)
[102334155][1597][102334155] in b817138163596 (fib=68330027629092351019822533679447, fi=154)
[267914296][610][267914296] in b817138163596 (fib=178890334785183168257455287891792, fi=156)
[701408733][233][701408733] in b817138163596 (fib=468340976726457153752543329995929, fi=158)
[1836311903][89][1836311903] in b817138163596 (fib=1226132595394188293000174702095995, fi=160)
[4807526976][34][4807526976] in b817138163596 (fib=3210056809456107725247980776292056, fi=162)
[12586269025][13][12586269025] in b817138163596 (fib=8404037832974134882743767626780173, fi=164)
[32951280099]5[32951280099] in b817138163596 (fib=22002056689466296922983322104048463, fi=166)
[86267571272]2[86267571272] in b817138163596 (fib=57602132235424755886206198685365216, fi=168)
[225851433717]1[225851433717] in b817138163596 (fib=150804340016807970735635273952047185, fi=170)
[365435296162]0[365435296162] in b817138163596 (fib=244006547798191185585064349218729154, fi=171)
[591286729879]1[591286729879] in b817138163596 (fib=394810887814999156320699623170776339, fi=172)

817138163596 = 2^2 * 229 * 9349 * 95419 (pal=30)

Power Trap

Back in 2015, in an article called “Power Trip”, I looked at an unfamiliar sequence created by deleting zeroes from a familiar sequence. And I made a serious but fortunately-not-fatal error in my reasoning. The familiar sequence was powers of 2:

• 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288, 1048576…

This is what happens when you delete the zeroes from the powers of 2 (and carry on multiplying by two):

2 * 2 = 4
4 * 2 = 8
8 * 2 = 16
16 * 2 = 32
32 * 2 = 64
64 * 2 = 128
128 * 2 = 256
256 * 2 = 512
512 * 2 = 1024 → 124
124 * 2 = 248
248 * 2 = 496
496 * 2 = 992
992 * 2 = 1984
1984 * 2 = 3968
3968 * 2 = 7936
7936 * 2 = 15872
15872 * 2 = 31744
31744 * 2 = 63488
63488 * 2 = 126976
126976 * 2 = 253952
253952 * 2 = 507904 → 5794
5794 * 2 = 11588
11588 * 2 = 23176
23176 * 2 = 46352
46352 * 2 = 92704 → 9274…


I pointed out that this new sequence has to repeat, because deleting zeroes prevents n growing beyond a certain size. Eventually, then, a number will repeat and the sequence will fall into a loop: “This happens at step 526 with 366784, which matches 366784 at step 490.”

But that’s deleting every zero. What happens if you delete every second zero? That is, you start with a zero-count, zc, of 0. When you meet the first zero in the sequence, zc = zc + 1 = 1. When you meet the second zero in the sequence, zc = zc + 1 = 2. So you delete that second zero and reset zc to 0. The first zero occurs when 1024 = 2 * 512, so 1024 is left as it is. The second zero occurs when 2 * 1024 = 2048, so 2048 becomes 248. The sequence for zc=2 looks like this:

1 * 2 = 2
2 * 2 = 4
4 * 2 = 8
8 * 2 = 16
16 * 2 = 32
32 * 2 = 64
64 * 2 = 128
128 * 2 = 256
256 * 2 = 512
512 * 2 = 1024 → 1024
1024 * 2 = 2048 → 248
248 * 2 = 496
496 * 2 = 992
992 * 2 = 1984
1984 * 2 = 3968
3968 * 2 = 7936
7936 * 2 = 15872
15872 * 2 = 31744
31744 * 2 = 63488
63488 * 2 = 126976
126976 * 2 = 253952
253952 * 2 = 507904 → 50794
50794 * 2 = 101588 → 101588
101588 * 2 = 203176 → 23176
23176 * 2 = 46352
46352 * 2 = 92704 → 92704
92704 * 2 = 185408 → 18548

Again, the sequence has to repeat and I claimed that it did so “at step 9134 with 5458864, which matches 5458864 at step 4166”. I also said that I hadn’t found the loop for the delete-every-third-zero sequence, where zc=3. Coming back to this type of sequence in 2021, I wrote a much faster machine-code program to see if I could find the answer for zc=3. And I thought that I had. My program said that the sequence for zc=3 repeats at step 166369 with 6138486272, which matches 6138486272 at step 25429.

Or does it repeat? Does it match? In 2021 I suddenly realized that I had neglected to consider something vital back in 2015: whether the zero-count was the same when the sequence appeared to repeat. Take the zc=2 sequence. If zc=0 at at step 4166 and zc=1 at 9134 (or vice versa), the sequence isn’t in a loop, because it will be deleting a different set of zeroes after step 4166 than it is after step 9134.

I checked whether the zero-count for that sequence is the same when the sequence appears to repeat. Fortunately, it is the same and the zero-delete sequence for zc=2 does indeed begin looping “at step 9134 with 5458864, which matches 5458864 at step 4166”.

So my error wasn’t fatal for the zc=2 sequence. But what about the zc=3 sequence? Alas, the zero-count is different for 6138486272 at step 166369 than for 6138486272 at step 25429. The sequence doesn’t behave the same after those steps and hasn’t looped. I needed to find the n1 = n2 for steps s1 and s2 where zc1 = zc2. And even with the much faster machine-code program it took some time. But I can now say that 958718377984 at step 379046, with zc=0, matches 958718377984 at step 200906, with zc=0.

Spiral Artefact

What’s the next number in this sequence of integers?


5, 14, 19, 23, 28, 32, 37, 41, 46, 50, 55... (A227793 at the OEIS)

It shouldn’t be hard to work out that it’s 64 — the sum-of-digits of n is divisible by 5, i.e., digsum(n) mod 5 = 0. Now try summing the numbers in that sequence:


5 + 14 = 19
19 + 19 = 38
38 + 23 = 61
61 + 28 = 89
89 + 32 = 121
121 + 37 = 158
158 + 41 = 199
199 + 46 = 245
[...]

Here are the cumulative sums as another sequence:


5, 19, 38, 61, 89, 121, 158, 199, 245, 295, 350, 414, 483, 556, 634, 716, 803, 894, 990, 1094, 1203, 1316, 1434, 1556, 1683, 1814, 1950, 2090, 2235, 2389, 2548, 2711, 2879, 3051, 3228, 3409, 3595, 3785, 3980, 4183, 4391, 4603, 4820, 5041, 5267, 5497, 5732, 5976, 6225...

And there’s that cumulative-sum sequence represented as a spiral:

Spiral for cumulative sum of n where digsum(n) mod 5 = 0


You can see how the spiral is created by following 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E… from the center:


ZYXWVU
GFEDCT
H432BS
I501AR
J6789Q
KLMNOP

What about other values for the cumulative sums of digsum(n) mod m = 0? Here’s m = 2,3,4,5,6,7:

Spiral for cumulative sum of n where digsum(n) mod 2 = 0
s1 = 2, 4, 6, 8, 11, 13, 15, 17, 19, 20, 22…
s2 = 2, 6, 12, 20, 31, 44, 59, 76, 95, 115… (cumulative sum of s1)


sum of digsum(n) mod 3 = 0
s1 = 3, 6, 9, 12, 15, 18, 21, 24, 27, 30, 33…
s2 = 3, 9, 18, 30, 45, 63, 84, 108, 135, 165…


sum of digsum(n) mod 4 = 0
s1 = 4, 8, 13, 17, 22, 26, 31, 35, 39, 40, 44…
s2 = 4, 12, 25, 42, 64, 90, 121, 156, 195, 235…


sum of digsum(n) mod 5 = 0
s1 = 5, 14, 19, 23, 28, 32, 37, 41, 46, 50, 55…
s2 = 5, 19, 38, 61, 89, 121, 158, 199, 245, 295…


sum of digsum(n) mod 6 = 0
s1 = 6, 15, 24, 33, 39, 42, 48, 51, 57, 60, 66…
s2 = 6, 21, 45, 78, 117, 159, 207, 258, 315, 375…


sum of digsum(n) mod 7 = 0
s1 = 7, 16, 25, 34, 43, 52, 59, 61, 68, 70, 77…
s2 = 7, 23, 48, 82, 125, 177, 236, 297, 365, 435…


The spiral for m = 2 is strange, but the spirals are similar after that. Until m = 8, when something strange happens again:

sum of digsum(n) mod 8 = 0
s1 = 8, 17, 26, 35, 44, 53, 62, 71, 79, 80, 88…
s2 = 8, 25, 51, 86, 130, 183, 245, 316, 395, 475…


Then the spirals return to normal for m = 9, 10:

sum of digsum(n) mod 9 = 0
s1 = 9, 18, 27, 36, 45, 54, 63, 72, 81, 90, 99…
s2 = 9, 27, 54, 90, 135, 189, 252, 324, 405, 495…


sum of digsum(n) mod 10 = 0
s1 = 19, 28, 37, 46, 55, 64, 73, 82, 91, 109, 118…
s2 = 19, 47, 84, 130, 185, 249, 322, 404, 495, 604…


Here’s an animated gif of m = 8 at higher and higher resolution:

sum of digsum(n) mod 8 = 0 (animated gif)


You might think this strange behavior is dependant on the base in which the dig-sum is calculated. It isn’t. Here’s an animated gif for other bases in which the mod-8 spiral behaves strangely:

sum of digsum(n) mod 8 = 0 in base b = 5, 6, 7, 9, 11, 12, 13 (animated gif)


But the mod-8 spiral stops behaving strangely when the spiral is like this, as a diamond:


   W
  XIV
 YJ8HU
ZK927GT
LA3016FS
 MB45ER
  NCDQ
   OP

Now the mod-8 spiral looks like this:

sum of digsum(n) mod 8 = 0 (diamond spiral)


But the mod-4 and mod-9 spirals look like this:

sum of digsum(n) mod 4 = 0 (diamond spiral)


sum of digsum(n) mod 9 = 0 (diamond spiral)


You can also construct the spirals as a triangle, like this:


     U
    VCT
   WD2CS
  XE301AR
 YF456789Q
ZGHIJKLMNOP

Here’s the beginning of the mod-5 triangular spiral:

sum of digsum(n) mod 5 = 0 (triangular spiral) (open in new window for full size)


And the beginning of the mod-8 triangular spiral:

sum of digsum(n) mod 8 = 0 (triangular spiral) (open in new window for full size)


The mod-8 spiral is behaving strangely again. So the strangeness is partly an artefact of the way the spirals are constructed.


Post-Performative Post-Scriptum

“Spiral Artefact”, the title of this incendiary intervention, is of course a tip-of-the-hat to core Black-Sabbath track “Spiral Architect”, off core Black-Sabbath album Sabbath Bloody Sabbath, issued in core Black-Sabbath success-period of 1973.