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

Lime Time

What do you get if you list every successive pair of entries in this sequence?

1, 2, 1, 3, 2, 3, 1, 4, 3, 4, 1, 5, 2, 5, 3, 5, 4, 5, 1, 6, 5, 6, 1, 7, 2, 7, 3, 7, 4, 7, 5, 7, 6, 7, 1, 8, 3, 8, 5, 8, 7, 8, 1, 9, 2, 9, 4, 9, 5, 9, 7, 9, 8, 9, 1, 10, 3, 10, 7, 10, 9, 10, 1, 11, 2, 11, 3, 11, 4, 11, 5, 11, 6, 11, 7, 11, 8, 11, 9, 11, 10, 11, 1, 12, 5, 12, 7, 12, 11, 12, 1, 13, … — A038568 at the Online Encyclopedia of Integer Sequence

You get the rational fractions ordered by denominator in their simplest form: 1/2, 1/3, 2/3, 1/4, 3/4, 1/5, 2/5, 3/5… There are no pairs like 2/4 and 5/35, because those can be simplified: 2/4 → 1/2; 15/35 → 3/7. You can get the same set of rational fractions by listing every successive pair in this sequence, the Stern-Brocot sequence:

1, 2, 1, 3, 2, 3, 1, 4, 3, 5, 2, 5, 3, 4, 1, 5, 4, 7, 3, 8, 5, 7, 2, 7, 5, 8, 3, 7, 4, 5, 1, 6, 5, 9, 4, 11, 7, 10, 3, 11, 8, 13, 5, 12, 7, 9, 2, 9, 7, 12, 5, 13, 8, 11, 3, 10, 7, 11, 4, 9, 5, 6, 1, 7, 6, 11, 5, 14, 9, 13, 4, 15, 11, 18, 7, 17, 10, 13, 3, 14, 11, 19, 8, 21, 13, 18, 5, 17, 12, 19, … — A002487 at the OEIS

But the fractions don’t come ordered by denominator this time. In fact, they seem to come at random: 1/2, 1/3, 2/3, 1/4, 3/5, 2/5, 3/4, 1/5, 4/7, 3/8, 5/7, 2/7, 5/8… But they’re not random at all. There’s a complicated way of generating them and a simple way. An amazingly simple way, I think:

Moshe Newman proved that the fraction a(n+1)/a(n+2) can be generated from the previous fraction a(n)/a(n+1) = x by 1/(2*floor(x) + 1 – x). The successor function f(x) = 1/(floor(x) + 1 – frac(x)) can also be used. — A002487, “Stern-Brocot Sequence”, at the OEIS

In another form, the Stern-Brocot sequence is generated by what’s called the Calkin-Wilf Tree. Now suppose you use the Stern-Brocot sequence to supply the x co-ordinate of an L-graph whose arms run from 0 to 1. And you use the Calkin-Wilf Tree to supply the y co-ordinate of the L-tree. What do you get? As I described in “I Like Gryke”, you get this fractal:

Limestone fractal


I call it a limestone fractal or pavement fractal or gryke fractal, because it reminds me of the fissured patterns you see in the limestone pavements of the Yorkshire Dales:

Fissured limestone pavement, Yorkshire Dales (Wikipedia)


But what happens when you plot the (x,y) of the Stern-Brocot sequence and the Calkin-Wilf Tree on a circle instead? You get an interestingly distorted limestone fractal:

Limestone fractal on circle


You can also plot the (x,y) around the perimeter of a polygon, then stretch the polygon into a circle. Here’s a square:

Limestone fractal on square

Limestone square stretched to circle


And here are a pentagon, hexagon, heptagon and octagon — note the interesting perspective effects:

Limestone fractal on pentagon

Limestone pentagon stretched to circle


Limestone fractal on hexagon

Limestone hexagon stretched to circle


Limestone fractal on heptagon

Limestone heptagon stretched to circle


Limestone fractal on octagon

Limestone octagon stretched to circle


And finally, here are animations of limestone polygons stretching to circles:

Limestone square stretched to circle (animated at EZgif)


Limestone pentagon to circle (animated)


Limestone hexagon to circle (animated)


Limestone heptagon to circle (animated)


Limestone octagon to circle (animated)


Previously Pre-Posted (Please Peruse)

I Like Gryke — a first look at the limestone fractal

Summult-Time Hues

sum(3,6) = 3 * 6 = 18
3 * 2.3 = 2.3^2
sum(15,35) = 15 * 35 = 525
3.5 * 5.7 = 3.5^2.7
sum(85,204) = 85 * 204 = 17340
5.17 * 2^2.3.17 = 2^2.3.5.17^2
sum(493,1189) = 493 * 1189 = 586177
17.29 * 29.41 = 17.29^2.41
sum(2871,6930) = 2871 * 6930 = 19896030
3^2.11.29 * 2.3^2.5.7.11 = 2.3^4.5.7.11^2.29
sum(16731,40391) = 16731 * 40391 = 675781821
3^2.11.13^2 * 13^2.239 = 3^2.11.13^4.239
[…]


Elsewhere Other-Accessible

1, 18, 525, 17340, 586177, 19896030, 675781821, 22956120408, 779829016225, 26491211221770, 899921240562957, 30570830315362260, 1038508305678375841, 35278711540581704598, 1198437683944896688125, 40711602541832856049200, 1382996048733983114022337 — A011906 at the Online Encyclopedia of Integer Sequences

Partitional Pulchritude

If you want a good example of how, in math, something very simple can quickly get very deep, just look at partitions. Here are the partitions of 1 to 5, that is, the ways 1 to 5 can be expressed as a sum of integers smaller than or equal to themselves:

1 = 1

numbpart(1) = 1


2 = 2
1 + 1 = 2

numbpart(2) = 2


3 = 3
1 + 2 = 3
1 + 1 + 1 = 3

numbpart(3) = 3


4 = 4
1 + 3 = 4
2 + 2 = 4
1 + 1 + 2 = 4
1 + 1 + 1 + 1 = 4

numbpart(4) = 5


5 = 5
1 + 4 = 5
2 + 3 = 5
1 + 1 + 3 = 5
1 + 2 + 2 = 5
1 + 1 + 1 + 2 = 5
1 + 1 + 1 + 1 + 1 = 5

numbpart(5) = 7


It’s very easy to understand the concept of partitions, but very difficult to understand how partitions behave. For example, here is numbpart(n), the count of partitions for 1, 2, 3,…

1, 2, 3, 5, 7, 11, 15, 22, 30, 42, 56, 77, 101, 135, 176, 231, 297, 385, 490, 627, 792, 1002, 1255, 1575, 1958, 2436, 3010, 3718, 4565, 5604, 6842, 8349, 10143, 12310, 14883, 17977, 21637, 26015, 31185, 37338, 44583, 53174, 63261, 75175, 89134, 105558, 124754, 147273, 173525, 204226, … A000041 at the Online Encyclopedia of Integer Sequences, “a(n) is the number of partitions of n (the partition numbers)”

What’s the formula for numbpart(n)? That’s a tricky question. And what’s the formula for the curves produced by counting the various lengths of partitions(n)? That’s another tricky question, but one thing is easy to see. As n gets bigger, the graph of countlen(partitions(n)) acquires a strange, lopsided beauty. Here are the partitions of 8, with the count of how many partitions of a particular length there are:

8 = 8 (1 partition of length 1)
1 + 7 = 8
2 + 6 = 8
3 + 5 = 8
4 + 4 = 8 (4 partitions of length 2)
1 + 1 + 6 = 8
1 + 2 + 5 = 8
1 + 3 + 4 = 8
2 + 2 + 4 = 8
2 + 3 + 3 = 8 (5 of length 3)
1 + 1 + 1 + 5 = 8
1 + 1 + 2 + 4 = 8
1 + 1 + 3 + 3 = 8
1 + 2 + 2 + 3 = 8
2 + 2 + 2 + 2 = 8 (5 of length 4)
1 + 1 + 1 + 1 + 4 = 8
1 + 1 + 1 + 2 + 3 = 8
1 + 1 + 2 + 2 + 2 = 8 (3 of length 5)
1 + 1 + 1 + 1 + 1 + 3 = 8
1 + 1 + 1 + 1 + 2 + 2 = 8 (2 of length 6)
1 + 1 + 1 + 1 + 1 + 1 + 2 = 8 (1 of length 7)
1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 = 8 (1 of length 8)

When counts like that are shown as a graph, the graphs look like this (maximum counts are normalized to the same height):


graph of countlen(partitions(2))



countlen(partitions(3))



countlen(partitions(4))



countlen(partitions(5))



countlen(partitions(6))



countlen(partitions(7))



countlen(partitions(8))



countlen(partitions(9))



countlen(partitions(10))



countlen(partitions(15))



countlen(partitions(20))



countlen(partitions(30))



countlen(partitions(40))



countlen(partitions(50))



countlen(partitions(60))



countlen(partitions(70))



countlen(partitions(80))



countlen(partitions(90))



countlen(partitions(100))



Animated gif of partlen graphs (courtesy EZgif)


The graphs have a long, low right tail because the counts rise to great heights very quick, then fall away again, as you can see with partitions(100):

1 = count(partitions(10),len=1)
50 = count(partitions(10),len=2)
833 = count(partitions(10),len=3)
7153 = count(partitions(10),len=4)
38225 = count(partitions(10),len=5)
143247 = count(partitions(10),len=6)

[…]

10643083 = count(partitions(10),len=16)
11022546 = count(partitions(10),len=17)
11087828 = count(partitions(10),len=18)
10885999 = count(partitions(10),len=19)
10474462 = count(partitions(10),len=20)

[…]

30 = count(partitions(10),len=91)
22 = count(partitions(10),len=92)
15 = count(partitions(10),len=93)
11 = count(partitions(10),len=94)
7 = count(partitions(10),len=95)
5 = count(partitions(10),len=96)
3 = count(partitions(10),len=97)
2 = count(partitions(10),len=98)
1 = count(partitions(10),len=99)
1 = count(partitions(10),len=100)

Feral Fractions

“The uniquely unrepresentative ‘Egyptian’ fraction.” That’s what David Wells calls 2/3 = 0·666… in The Penguin Dictionary of Curious and Interesting Numbers (1986). Why unrepresentative”? Wells goes on to explain: “the Egyptians used only unit fractions, with this one exception. All other fractional quantities were expressed as sums of unit fractions.”

A unit fraction is 1 divided by a higher integer: 1/2, 1/3, 1/4, 1/5 and so on. Modern mathematicians are interested in those sums of unit fractions that produce integers, like this:

1 = 1/2 + 1/3 + 1/6 = egypt(2,3,6)
1 = 1/2 + 1/4 + 1/6 + 1/12 = egypt(2,4,6,12)
1 = 1/2 + 1/3 + 1/10 + 1/15 = = egypt(2,3,10,15)
1 = egypt(2,4,10,12,15)
1 = egypt(3,4,6,10,12,15)
1 = egypt(2,3,9,18)
1 = egypt(2,4,9,12,18)
1 = egypt(3,4,6,9,12,18)
1 = egypt(2,6,9,10,15,18)
1 = egypt(3,4,9,10,12,15,18)
1 = egypt(2,4,5,20)
1 = egypt(3,4,5,6,20)
1 = egypt(2,5,6,12,20)
1 = egypt(3,4,5,10,15,20)
1 = egypt(2,5,10,12,15,20)
1 = egypt(3,5,6,10,12,15,20)
1 = egypt(3,4,5,9,18,20)
1 = egypt(2,5,9,12,18,20)
1 = egypt(3,5,6,9,12,18,20)
1 = egypt(4,5,6,9,10,15,18,20)

2 = egypt(2,3,4,5,6,8,9,10,15,18,20,24)
2 = 1/2 + 1/3 + 1/4 + 1/5 + 1/6 + 1/8 + 1/9 + 1/10 + 1/15 + 1/18 + 1/20 + 1/24


Sums-to-integers like those are called Egyptian fractions, for short. I looked for some such sums that included 1/666:

1 = egypt(2,3,7,63,222,518,666)
1 = egypt(2,3,8,36,111,296,666)
1 = egypt(2,3,9,20,444,555,666)
1 = egypt(2,3,9,21,222,518,666)
1 = egypt(2,3,9,24,111,296,666)
1 = egypt(2,3,9,26,74,481,666)
1 = egypt(2,4,8,9,111,296,666)


And I looked for Egyptian fractions whose denominators summed to rep-digits like 111 and 666 (denominators are the bit below the stroke of 1/3 or 2/3, where the bit above is called the numerator):

1 = egypt(4,6,7,9,10,14,15,18,28)
111 = 4+6+7+9+10+14+15+18+28


1 = egypt(3,6,8,9,10,15,21,24,126)
222 = 3+6+8+9+10+15+21+24+126


1 = egypt(2,6,8,12,16,17,272)
333 = 2+6+8+12+16+17+272


1 = egypt(2,4,9,11,22,396)
444 = 2+4+9+11+22+396


1 = egypt(5,6,9,10,11,12,15,20,21,22,28,396)
555 = 5+6+9+10+11+12+15+20+21+22+28+396


1 = egypt(2,6,8,10,15,25,600)
666 = 2+6+8+10+15+25+600


1 = egypt(4,5,8,12,14,18,20,21,24,26,28,819)
999 = 4+5+8+12+14+18+20+21+24+26+28+819


Alas, Egyptian fractions like those are attractive but trivial. This isn’t trivial, though:

Prof Greg Martin of the University of British Columbia has found a remarkable Egyptian fraction for 1 with 454 denominators all less than 1000.

1 = egypt(97, 103, 109, 113, 127, 131, 137, 190, 192, 194, 195, 196, 198, 200, 203, 204, 205, 206, 207, 208, 209, 210, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 225, 228, 230, 231, 234, 235, 238, 240, 244, 245, 248, 252, 253, 254, 255, 256, 259, 264, 265, 266, 267, 268, 272, 273, 274, 275, 279, 280, 282, 284, 285, 286, 287, 290, 291, 294, 295, 296, 299, 300, 301, 303, 304, 306, 308, 309, 312, 315, 319, 320, 321, 322, 323, 327, 328, 329, 330, 332, 333, 335, 338, 339, 341, 342, 344, 345, 348, 351, 352, 354, 357, 360, 363, 364, 365, 366, 369, 370, 371, 372, 374, 376, 377, 378, 380, 385, 387, 390, 391, 392, 395, 396, 399, 402, 403, 404, 405, 406, 408, 410, 411, 412, 414, 415, 416, 418, 420, 423, 424, 425, 426, 427, 428, 429, 430, 432, 434, 435, 437, 438, 440, 442, 445, 448, 450, 451, 452, 455, 456, 459, 460, 462, 464, 465, 468, 469, 470, 472, 473, 474, 475, 476, 477, 480, 481, 483, 484, 485, 486, 488, 490, 492, 493, 494, 495, 496, 497, 498, 504, 505, 506, 507, 508, 510, 511, 513, 515, 516, 517, 520, 522, 524, 525, 527, 528, 530, 531, 532, 533, 536, 539, 540, 546, 548, 549, 550, 551, 552, 553, 555, 558, 559, 560, 561, 564, 567, 568, 570, 572, 574, 575, 576, 580, 581, 582, 583, 584, 585, 588, 589, 590, 594, 595, 598, 603, 605, 608, 609, 610, 611, 612, 616, 618, 620, 621, 623, 624, 627, 630, 635, 636, 637, 638, 640, 642, 644, 645, 646, 648, 649, 650, 651, 654, 657, 658, 660, 663, 664, 665, 666, 667, 670, 671, 672, 675, 676, 678, 679, 680, 682, 684, 685, 688, 689, 690, 693, 696, 700, 702, 703, 704, 705, 707, 708, 710, 711, 712, 713, 714, 715, 720, 725, 726, 728, 730, 731, 735, 736, 740, 741, 742, 744, 748, 752, 754, 756, 759, 760, 762, 763, 765, 767, 768, 770, 774, 775, 776, 777, 780, 781, 782, 783, 784, 786, 790, 791, 792, 793, 798, 799, 800, 804, 805, 806, 808, 810, 812, 814, 816, 817, 819, 824, 825, 826, 828, 830, 832, 833, 836, 837, 840, 847, 848, 850, 851, 852, 854, 855, 856, 858, 860, 864, 868, 869, 870, 871, 872, 873, 874, 876, 880, 882, 884, 888, 890, 891, 893, 896, 897, 899, 900, 901, 903, 904, 909, 910, 912, 913, 915, 917, 918, 920, 923, 924, 925, 928, 930, 931, 935, 936, 938, 940, 944, 945, 946, 948, 949, 950, 952, 954, 957, 960, 962, 963, 966, 968, 969, 972, 975, 976, 979, 980, 981, 986, 987, 988, 989, 990, 992, 994, 996, 999) — "Egyptian Fractions" by Ron Knott at Surrey University


Phascinating Phibonacci Phact Phor Phiday

Phiday falls on the 11th, 12th and 23rd of each month, because 11, 12 and 23 represent entries in the famous Fibonacci sequence:

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, 165580141, 267914296, 433494437, 701408733, 1134903170, 1836311903, 2971215073, 4807526976, 7778742049, 12586269025, 20365011074, 32951280099, 53316291173, 86267571272, 139583862445, 225851433717, 365435296162, 591286729879, 956722026041, 1548008755920, 2504730781961, 4052739537881, 6557470319842, 10610209857723, 17167680177565, 27777890035288, 44945570212853, 72723460248141, 117669030460994, 190392490709135, 308061521170129, 498454011879264, 806515533049393, 1304969544928657, …

Successive entries in the Fibonacci sequence provide better and better approximations to the golden ratio or φ = 1.61803398874989484820458683…

2 = 2/1
1.5 = 3/2
1.6 = 5/3
1.6 = 8/5
1.625 = 13/8
1.6153846… = 21/13
1.619047619… = 34/21
1.6176470588235294117647… = 55/34
1.618… = 89/55
1.617977528… = 144/89
1.61805… = 233/144
1.618025751… = 377/233
1.618037135… = 610/377
1.618032786… = 987/610
1.618034447… = 1597/987
1.618033813… = 2584/1597
1.618034055… = 4181/2584
1.618033963… = 6765/4181
1.618033998… = 10946/6765
1.618033985… = 17711/10946

Today is 23rd June, so here’s a Fascinating Fibonacci Fact for Phiday. First, list the rational fractions < 1 in simplified form and mark the Fibonacci fractions:

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

Next, record the positions in the fraction list of the FibFracs, i.e. pos(fibonacci(i)/fibonacci(i+1)) = pos(fibfrac(i)):

1, 3, 8, 20, 53, 135, 353, 924, 2422, 6311, 16529, 43229, 113066, 296173, 775286, 2029661, 5313844, 13911391, 36419909, 95348490, 249624578, 653521015, 1710943906, 4479312193, 11726939926, 30701521655, 80377560978, 210431191133, 550915866198, 1442316294349, 3776032465954, 9885782372588, 25881314454327, 67758160822605, 177393168080718, 464421339906882, 1215870841639593, …

What do you get when you divide pos(fibfrac(i+1)) by pos(fibfrac(i))?

pos(1/2) = 1
pos(2/3) = 3 (3/1 = 3)
pos(3/5) = 8 (8/3 = 2.6…)
pos(5/8) = 20 (20/8 = 2.5)
pos(8/13) = 53 (53/20 = 2.65)
pos(13/21) = 135 (2.5471698113207…)
pos(21/34) = 353 (2.6148…)
pos(34/55) = 924 (2.617563739376770538243626062…)
pos(55/89) = 2422 (2.621…)
pos(89/144) = 6311 (2.605697770437654830718414533…)
pos(144/233) = 16529 (2.619077800665504674378070037…)
pos(233/377) = 43229 (2.615342730957710690301893642…)
pos(377/610) = 113066 (2.615512734506928219482291980…)
pos(610/987) = 296173 (2.619470044045071020465922559…)
pos(987/1597) = 775286 (2.617679531895209894217231145…)
pos(1597/2584) = 2029661 (2.617951310871084993150914630…)
pos(2584/4181) = 5313844 (2.618094351716863062353762525…)
pos(4181/6765) = 13911391 (2.617952465296309037299551888…)
pos(6765/10946) = 36419909 (2.617991903182075753603647543…)
pos(10946/17711) = 95348490 (2.618032076906068051954770123…)
pos(17711/28657) = 249624578 (2.618023400265699016313735016…)
pos(28657/46368) = 653521015 (2.618015502463863954934758067…)
pos(46368/75025) = 1710943906 (2.618039614227248683043497844…)
pos(75025/121393) = 4479312193 (2.618035680358535377956453004…)
pos(121393/196418) = 11726939926 (2.618022459860278821159630657…)
pos(196418/317811) = 30701521655 (2.618033506501651708043379296…)
pos(317811/514229) = 80377560978 (2.618031831816708695313688353…)
pos(514229/832040) = 210431191133 (2.618034045479393794998913484…)
pos(832040/1346269) = 550915866198 (2.618033302153394031845776103…)
pos(1346269/2178309) = 1442316294349 (2.618033683260502304564996035…)
pos(2178309/3524578) = 3776032465954 (2.618033562227999267671331082…)
pos(3524578/5702887) = 9885782372588 (2.618034262608066669117450079…)
pos(5702887/9227465) = 25881314454327 (2.618034008728793003503058474…)
pos(9227465/14930352) = 67758160822605 (2.618033985181798482654668954…)
pos(14930352/24157817) = 177393168080718 (2.618033989221521810752093192…)
pos(24157817/39088169) = 464421339906882 (2.618033969017113072183685603…)
pos(39088169/63245986) = 1215870841639593 (2.618033964338027806153843993…)
[…]

In other words, pos(fibfrac(i+1)) / pos(fibfrac(i)) → φ^2 = 2.61803398874989484820458683… = φ + 1


Previously Pre-Posted (Please Peruse)

Friday is Φiday

Friday is Φiday

The 11th, 12th and 23rd day of a month can be called a φ-day (pronounced fy-day). Why so? Because those numbers are consecutive entries in the famous Fibonacci sequence, which offers better and better approximations to a mathematical constant called φ = (√5 + 1) / 2 = 1.6180339887498948…:

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

Each number after the second is the sum of the preceding two (so 11, 12, 23… could be the start of a similar sequence). When you divide fib(i) by fib(i-1), you get these approximations to φ:

2 = 2/1
1.5 = 3/2
1.6 = 5/3
1.6 = 8/5
1.625 = 13/8
1.6153846… = 21/13
1.619047619… = 34/21
1.6176470588235294117647… = 55/34
1.618… = 89/55
1.617977528… = 144/89
1.61805… = 233/144
1.618025751… = 377/233
1.618037135… = 610/377
1.618032786… = 987/610
1.618034447… = 1597/987
1.618033813… = 2584/1597
1.618034055… = 4181/2584
1.618033963… = 6765/4181
1.618033998… = 10946/6765
1.618033985… = 17711/10946

Today is the 23rd and not just a φ-day but a Friday (or φriday). So here’s one of the interesting results I’ve recently found while playing with the Fibonacci sequence. As any recreational mathematician kno, you can also find the Fibonacci sequence — and φ — with this little algorithm:

f = 0
LOOP
f = 1 / (f + 1)
print(f)
goto LOOP

The algorithm returns these values:

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

I was playing with that algorithm and got an unexpected result with a simple adaptation of it:

f = 0
LOOP
f = 1 / (3 – f)
print(f)
goto LOOP

The values of f generated by this adapted algorithm are:

1/3, 3/8, 8/21, 21/55, 55/144, 144/377, 377/987, 987/2584, 2584/6765, 6765/17711, 17711/46368, 46368/121393, 121393/317811, 317811/832040, 832040/2178309, 2178309/5702887, 5702887/14930352, 14930352/39088169, 39088169/102334155, 102334155/267914296, …

The numerator and denominator in each fraction are next-but-one Fibonacci numbers, beautifully generated at each step:

3 – 0 = 3 → 1/3
3 – 1/3 = (3*3)/3 – 1/3 = 9/3 – 1/3 = (9-1) / 3 = 8 / 3 → 1/(8/3) = 3/8
3 – 3/8 = (3*8)/3 – 3/8 = 24/8 – 3/8 = (24-3) / 8 = 21/8 → 1/(21/8) = 8/21
3 – 8/21 = (3*21)/21 – 8/21 = 63/21 – 8/21 = (63-8)/21 = 55/21 → 1/(55/21) = 21/55
3 – 21/55 = (3*55)/55 – 21/55 = 165/55 – 21/55 = (165-21)/55 = 144/55 → 1/(144/55) = 55/144
3 – 55/144 = (3*144)/144 – 55/144 = (432-55)/144 = 377/144 → 1/(377/144) = 144/377
3 – 144/377 = (3*377)/377 – 144/377 = (1131-144)/377 = 987/377 → 1/(987/377) = 377/987
[…]

If you reverse numerator and denominator, the limit of the fraction is φ^2 = 2.6180339887498948… = φ+1:

3 = 3/1
2.6 = 8/3
2.625 = 21/8
2.6190476190476190476190476… = 55/21
2.6181818181818181818181818… = 144/55
2.6180555555555555555555555… = 377/144
2.6180371352785145888594164… = 987/377
2.6180344478216818642350557… = 2584/987
2.6180340557275541795665634… = 6765/2584
2.6180339985218033998521803… = 17711/6765
2.6180339901755970865563773… = 46368/17711
2.6180339889579020013802622… = 121393/46368
2.6180339887802426828565073… = 317811/121393
2.6180339887543225376088304… = 832040/317811
2.6180339887505408393827219… = 2178309/832040
2.6180339887499890970472967… = 5702887/2178309
2.6180339887499085989254214… = 14930352/5702887
2.6180339887498968544077192… = 39088169/14930352
2.6180339887498951409056791… = 102334155/39088169
2.6180339887498948909091006… = 267914296/102334155

The Call of CFulhu

“The most merciful thing in the world, I think, is the inability of the human mind to correlate all its contents.” So said HPL in “The Call of Cthulhu” (1926). But I’d still like to correlate the contents of mine a bit better. For example, I knew that φ, the golden ratio, is the most irrational of all numbers, in that it is the slowest to be approximated with rational fractions. And I also knew that continued fractions, or CFs, were a way of representing both rationals and irrationals as a string of numbers, like this:

contfrac(10/7) = [1; 2, 3]
10/7 = 1 + 1/(2 + 1/3)
10/7 = 1.428571428571…

contfrac(3/5) = [0; 1, 1, 2]
4/5 = 0 + 1/(1 + 1/(1 + 1/2))
4/5 = 0.8

contfrac(11/8) = [1; 2, 1, 2]
11/8 = 1 + 1/(2 + 1/(1 + 1/2))
11/8 = 1.375

contfrac(4/7) = [0; 1, 1, 3]
4/7 = 0 + 1/(1 + 1/(1 + 1/3))
4/7 = 0.57142857142…

contfrac(17/19) = [0; 1, 8, 2]
17/19 = 0 + 1/(1 + 1/(8 + 1/2))
17/19 = 0.8947368421052…

contfrac(8/25) = [0; 3, 8]
8/25 = 0 + 1/(3 + 1/8)
8/25 = 0.32

contfrac(√2) = [1; 2, 2, 2, 2, 2, 2, 2…] = [1; 2]

√2 = 1 + 1/(2 + 1/(2 + 1/(2 + 1/(2 + 1/(2 + 1/(2 + 1/2 + …))))))

√2 = 1.41421356237309504…

contfrac(φ) = [1; 1, 1, 1, 1, 1, 1, 1, 1…]

φ = 1/(1 + 1/(1 + 1/(1 + 1/(1 + 1/(1 + 1/(1 + 1/(1 + 1/1 + …)))))))

φ = 1.6180339887498948…


But I didn’t correlate those two contents of my mind: the maximal irrationality of φ and the way continued fractions work.

That’s why I was surprised when I was looking at the continued fractions of 2..(n-1) / n for 3,4,5,6,7… That is, I was looking at the continued fractions of 2/3, 3/4, 2/5, 3/5, 4/5, 5/6, 2/7, 3/7… (skipping fractions like 2/4, 2/6, 3/6 etc, because they’re reducible: 2/4 = ½, 2/6 = 1/3, 3/6 = ½ etc). I wondered which fractions set successive records for the length of their continued fractions as one worked through ½, 2/3, 3/4, 2/5, 3/5, 4/5, 5/6, 2/7, 3/7… And because I hadn’t correlated the contents of my mind, I was surprised at the result. I shouldn’t have been, of course:

contfrac(1/2) = [0; 2] (cfl=1)
1/2 = 0 + 1/2
1/2 = 0.5

contfrac(2/3) = [0; 1, 2] (cfl=2)
2/3 = 0 + 1/(1 + 1/2)
2/3 = 0.666666666…

contfrac(3/5) = [0; 1, 1, 2] (cfl=3)
3/5 = 0 + 1/(1 + 1/(1 + 1/2))
3/5 = 0.6

contfrac(5/8) = [0; 1, 1, 1, 2] (cfl=4)
5/8 = 0 + 1/(1 + 1/(1 + 1/(1 + 1/2)))
5/8 = 0.625

contfrac(8/13) = [0; 1, 1, 1, 1, 2] (cfl=5)
8/13 = 0 + 1/(1 + 1/(1 + 1/(1 + 1/(1 + 1/2))))
8/13 = 0.615384615…

contfrac(13/21) = [0; 1, 1, 1, 1, 1, 2] (cfl=6)
13/21 = 0 + 1/(1 + 1/(1 + 1/(1 + 1/(1 + 1/(1 + 1/2)))))
13/21 = 0.619047619…

contfrac(21/34) = [0; 1, 1, 1, 1, 1, 1, 2] (cfl=7)
21/34 = 0 + 1/(1 + 1/(1 + 1/(1 + 1/(1 + 1/(1 + 1/(1 + 1/2))))))
21/34 = 0.617647059…

contfrac(34/55) = [0; 1, 1, 1, 1, 1, 1, 1, 2] (cfl=8)
contfrac(55/89) = [0; 1, 1, 1, 1, 1, 1, 1, 1, 2] (cfl=9)
contfrac(89/144) = [0; 1, 1, 1, 1, 1, 1, 1, 1, 1, 2] (cfl=10)
contfrac(144/233) = [0; 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2] (cfl=11)
contfrac(233/377) = [0; 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2] (cfl=12)
contfrac(377/610) = [0; 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2] (cfl=13)
contfrac(610/987) = [0; 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2] (cfl=14)
contfrac(987/1597) = [0; 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2] (cfl=15)
contfrac(1597/2584) = [0; 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2] (cfl=16)
contfrac(2584/4181) = [0; 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2] (cfl=17)
contfrac(4181/6765) = [0; 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2] (cfl=18)
[…]


Which n1/n2 set records for the length of their continued fractions (with n2 > n1)? It’s the successive Fibonacci fractions, fib(i)/fib(i+1), of course. I didn’t anticipate that answer because I didn’t understand φ and continued fractions properly. And I still don’t, because I’ve been surprised again today looking at palindromic CFs like these:

contfrac(2/5) = [0; 2, 2] (cfl=2)
2/5 = 0 + 1/(2 + 1/2)
2/5 = 0.4

contfrac(3/8) = [0; 2, 1, 2] (cfl=3)
3/8 = 0 + 1/(2 + 1/(1 + 1/2))
3/8 = 0.375

contfrac(3/10) = [0; 3, 3] (cfl=2)
3/10 = 0 + 1/(3 + 1/3)
3/10 = 0.3

contfrac(5/12) = [0; 2, 2, 2] (cfl=3)
5/12 = 0 + 1/(2 + 1/(2 + 1/2))
5/12 = 0.416666666…

contfrac(5/13) = [0; 2, 1, 1, 2] (cfl=4)
5/13 = 0 + 1/(2 + 1/(1 + 1/(1 + 1/2)))
5/13 = 0.384615384…

contfrac(4/15) = [0; 3, 1, 3] (cfl=3)
4/15 = 0 + 1/(3 + 1/(1 + 1/3))
4/15 = 0.266666666…

contfrac(7/16) = [0; 2, 3, 2] (cfl=3)
7/16 = 0 + 1/(2 + 1/(3 + 1/2))
7/16 = 0.4375

contfrac(4/17) = [0; 4, 4] (cfl=2)
4/17 = 0 + 1/(4 + 1/4)
4/17 = 0.235294117…


Again, I wondered which of these fractions set successive records for the length of their palindromic continued fractions. Here’s the answer:

contfrac(1/2) = [0; 2] (cfl=1)
1/2 = 0 + 1/2
1/2 = 0.5

contfrac(2/5) = [0; 2, 2] (cfl=2)
2/5 = 0 + 1/(2 + 1/2)
2/5 = 0.4

contfrac(3/8) = [0; 2, 1, 2] (cfl=3)
3/8 = 0 + 1/(2 + 1/(1 + 1/2))
3/8 = 0.375

contfrac(5/13) = [0; 2, 1, 1, 2] (cfl=4)
5/13 = 0 + 1/(2 + 1/(1 + 1/(1 + 1/2)))
5/13 = 0.384615384…

contfrac(8/21) = [0; 2, 1, 1, 1, 2] (cfl=5)
8/21 = 0 + 1/(2 + 1/(1 + 1/(1 + 1/(1 + 1/2))))
8/21 = 0.380952380…

contfrac(13/34) = [0; 2, 1, 1, 1, 1, 2] (cfl=6)
13/34 = 0 + 1/(2 + 1/(1 + 1/(1 + 1/(
1
+ 1/(1 + 1/2)))))
13/34 = 0.382352941..

contfrac(21/55) = [0; 2, 1, 1, 1, 1, 1, 2] (cfl=7)
21/55 = 0 + 1/(2 + 1/(1 + 1/(1 + 1/(1 + 1/(1 + 1/(1 + 1/2))))))
21/55 = 0.381818181…

contfrac(34/89) = [0; 2, 1, 1, 1, 1, 1, 1, 2] (cfl=8)
contfrac(55/144) = [0; 2, 1, 1, 1, 1, 1, 1, 1, 2] (cfl=9)
contfrac(89/233) = [0; 2, 1, 1, 1, 1, 1, 1, 1, 1, 2] (cfl=10)
contfrac(144/377) = [0; 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2] (cfl=11)
contfrac(233/610) = [0; 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2] (cfl=12)
contfrac(377/987) = [0; 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2] (cfl=13)
contfrac(610/1597) = [0; 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2] (cfl=14)
contfrac(987/2584) = [0; 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2] (cfl=15)
contfrac(1597/4181) = [0; 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2] (cfl=16)
contfrac(2584/6765) = [0; 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2] (cfl=17)
[…]


Now it’s the successive Fibonacci skip-one fractions, fib(i)/fib(i+2), that set records for the length of their palindromic continued fractions. But I think you’d have to be very good at maths not to be surprised by that result.

After that, I continued to be compelled by the Call of CFulhu and started to look at the CFs of Fibonacci skip-n fractions in general. That’s contfrac(fib(i)/fib(i+n)) for n = 1,2,3,… And I’ve found more interesting patterns, as I’ll describe in a follow-up post.

hail(Satan)!

It’s a very simple function that raises a very difficult question. An unanswered question, in fact. Take any whole number. If it’s odd, multiply it by 3 and add 1. If it’s even, divide it by 2. Repeat until you reach 1. That’s the hailstone function, because the numbers rise and fall like hailstones being formed in a cloud. Here are some examples:

5 → 16 → 8 → 4 → 2 → 1 (steps=5)


3 → 10 → 5 → 16 → 8 → 4 → 2 → 1 (st=7)


7 → 22 → 11 → 34 → 17 → 52 → 26 → 13 → 40 → 20 → 10 → 5 → 16 → 8 → 4 → 2 → 1 (st=16)

Graph for hail(7) = 16 (mx=52)


25 → 76 → 38 → 19 → 58 → 29 → 88 → 44 → 22 → 11 → 34 → 17 → 52 → 26 → 13 → 40 →
20 → 10 → 5 → 16 → 8 → 4 → 2 → 1 (st=23)

Graph for hail(25) = 23 (mx=88)


But is this function truly a hailstone function? That is, does every number fall finally to earth and reach 1? So far, for every number tested, the answer has been yes. But do all numbers reach 1? The Collatz conjecture says they do. But no-one can prove it. Or disprove it. All it would take is one number failing to fall to earth. Mathematicians don’t think there is one, but numbers can take a surprising length of time to get to the ground. Here’s 27:

27 → 82 → 41 → 124 → 62 → 31 → 94 → 47 → 142 → 71 → 214 → 107 → 322 → 161 → 484 → 242 → 121 → 364 → 182 → 91 → 274 → 137 → 412 → 206 → 103 → 310 → 155 → 466 → 233 → 700 → 350 → 175 → 526 → 263 → 790 → 395 → 1186 → 593 → 1780 → 890 → 445 → 1336 → 668 → 334 → 167 → 502 → 251 → 754 → 377 → 1132 → 566 → 283 → 850 → 425 → 1276 → 638 → 319 → 958 → 479 → 1438 → 719 → 2158 → 1079 → 3238 → 1619 → 4858 → 2429 → 7288 → 3644 → 1822 → 911 → 2734 → 1367 → 4102 → 2051 → 6154 → 3077 → 9232 → 4616 → 2308 → 1154 → 577 → 1732 → 866 → 433 → 1300 → 650 → 325 → 976 → 488 → 244 → 122 → 61 → 184 → 92 → 46 → 23 → 70 → 35 → 106 → 53 → 160 → 80 → 40 → 20 → 10 → 5 → 16 → 8 → 4 → 2 → 1 (st=111)

Graph for hail(27) = 111 (mx=9232)


27 takes 111 steps to reach 1. And the 111 made me think of another question. If the function hail(n) returns the number of steps required for n to reach 1, then hail(27) = 111. But what about hail(n) = 666? That is, what is the first number that requires 666 steps to reach 1? I say “first number”, because one very big number is guaranteed to take 666 steps:

666 = hail(306,180,206,916,083,902,309,240,650,087,602,475,282,639,486,413,866,622,
577,088,471,913,520,022,894,784,390,350,900,738,050,555,138,105,234,536,857,820,245,
071,373,614,031,482,942,161,565,170,086,143,298,589,738,273,508,330,367,307,539,078,
392,896,587,187,265,470,464)

Put another way, 666 = hail(2^666), because for any power of 2, hail(2^p) = p. But is there a smaller number, which I’ll call satan, for which hail(satan) = 666? Here’s a tantalizing taster of the task:

hail(27) = 111 (mx=9232)
hail(30262) = 222 (mx=2484916)
hail(164521) = 333 (mx=21933016)
hail(886953) = 444 (mx=52483285312)
hail(5143151) = 555 (mx=125218704148)
hail(satan) = 666 (mx=?)


But what is satan? Before I answer, here are some more graphs for interesting hail(n):

hail(231) = 127 (mx=9232)


hail(327) = 143 (mx=9232)


hail(703) = 170 (mx=250504)


hail(871) = 178 (mx=190996)


hail(2223) = 182 (mx=250504)


hail(3711) = 237 (mx=481624)


hail(35655) = 323 (mx=41163712)


hail(142587) = 374 (mx=593279152)


Now I’ll answer the question. If satan = 26597116, then hail(satan) = 666:

hail(26597116) = 666 (mx=15208728208)


Therefore:

hail(satan)! =
1,010,632,056,840,781,493,390,822,708,129,876,451,757,582,398,324,145,411,
340,420,807,357,413,802,103,697,022,989,202,806,801,491,012,040,989,802,
203,557,527,039,339,704,057,130,729,302,834,542,423,840,165,856,428,740,
661,530,297,972,410,682,828,699,397,176,884,342,513,509,493,787,480,774,
903,493,389,255,262,878,341,761,883,261,899,426,484,944,657,161,693,131,
380,311,117,619,573,051,526,423,320,389,641,805,410,816,067,607,893,067,
483,259,816,815,364,609,828,668,662,748,110,385,603,657,973,284,604,842,
078,094,141,556,427,708,745,345,100,598,829,488,472,505,949,071,967,727,
270,911,965,060,885,209,294,340,665,506,480,226,426,083,357,901,503,097,
781,140,832,497,013,738,079,112,777,615,719,116,203,317,542,199,999,489,
227,144,752,667,085,796,752,482,688,850,461,263,732,284,539,176,142,365,
823,973,696,764,537,603,278,769,322,286,708,855,475,069,835,681,643,710,
846,140,569,769,330,065,775,414,413,083,501,043,659,572,299,454,446,517,
242,824,002,140,555,140,464,296,291,001,901,438,414,675,730,552,964,914,
569,269,734,038,500,764,140,551,143,642,836,128,613,304,734,147,348,086,
095,123,859,660,926,788,460,671,181,469,216,252,213,374,650,499,557,831,
741,950,594,827,147,225,699,896,414,088,694,251,261,045,196,672,567,495,
532,228,826,719,381,606,116,974,003,112,642,111,561,332,573,503,212,960,
729,711,781,993,903,877,416,394,381,718,464,765,527,575,014,252,129,040,
283,236,963,922,624,344,456,975,024,058,167,368,431,809,068,544,577,258,
472,983,979,437,818,072,648,213,608,650,098,749,369,761,056,961,203,791,
265,363,665,664,696,802,245,199,962,040,041,544,438,210,327,210,476,982,
203,348,458,596,093,079,296,569,561,267,409,473,914,124,132,102,055,811,
493,736,199,668,788,534,872,321,705,360,511,305,248,710,796,441,479,213,
354,542,583,576,076,596,250,213,454,667,968,837,996,023,273,163,069,094,
700,429,467,106,663,925,419,581,193,136,339,860,545,658,673,623,955,231,
932,399,404,809,404,108,767,232,000,000,000,000,000,000,000,000,000,000,
000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,
000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,
000,000,000,000,000,000,000,000,000 = 666!


Here’s a question I haven’t answered: if satanic numbers are those n satisfying hail(n) = 666, how many satanic numbers are there? We’ve already seen two of them: 666 = hail(2^666) = hail(26597116). But how many more are there? Not infinitely many, because for n > 2^666, hail(n) > 666. In fact, after satan = 26597116, the next three satanic numbers arrive very quickly:

hail(satan+0) = 666 = hail(26597116)
hail(satan+1) = 666 = hail(26597117)
hail(satan+2) = 666 = hail(26597118)
hail(satan+3) = 666 = hail(26597119)

hail(satan-1) = 180 = hail(26597115)
hail(satan+4) = 180 = hail(26597120)


So there are four consecutive satanic numbers. But it isn’t unusual for a run of consecutive numbers to have the same hail(). Here’s a graph of the values of hail(n) for n = 1,2,3… (running left-to-right, down-up, with 1,2,3… in the lower lefthand corner). When n is divisible by 10, hail(n) is represented in red; when n is odd and divisible by 5, hail(n) is green. Note how many runs of identical hail(n) there are:

Graph for hail(n)


Here are successive records for runs of identical hail(n):

hail(12..13) = 9 (run=2)
hail(28..30) = 18 (run=3)
hail(98..102) = 25 (r=5)
hail(386..391) = 120 (r=6)
hail(943..949) = 36 (r=7)
hail(1494..1501) = 47 (r=8)
hail(1680..1688) = 42 (r=9)
hail(2987..3000) = 48 (r=14)
hail(7083..7099) = 57 (r=17)
hail(57346..57370) = 78 (r=25)
hail(252548..252574) = 181 (r=27)
hail(331778..331806) = 91 (r=29)
hail(524289..524318) = 102 (r=30)
hail(596310..596349) = 97 (r=40)


Finally, here’s Poland’s finest putting the function of 26597116 to music:

“Hail Satan!” by Dopelord


Elsewhere Other-Accessible…

Dopelord at Bandcamp

Mods and Clockers

To understand clock-arithmetic, simply picture a clock-face with one hand and a big fat 0 in place of the 12. Now you can do some clock-arithmetic. For example, set the hour-hand to 5, then move on 4 hours. You’ve done this sum:

5 + 4 → 9

Now try 9 + 7. The hour-hand is already on 9, so move forward 7 hours:

9 + 7 → 4

Now try 3 + 8 + 1:

3 + 8 + 1 → 0

And 3 * 4:

4 * 3 = 4 + 4 + 4 → 0

That’s clock-arithmetic. But you’re not confined to 12-hour clocks. Here’s a 7-hour clock, where the 7 is replaced with a 0:

3 + 1 → 4
4 + 5 → 2
2 + 4 + 1 → 0
3 * 3 = 3 + 3 + 3 → 2

Another name for clock-arithmetic is modular arithmetic, because the clocks model the process of dividing a number by 12 or 7 and finding the remainder or residue — 12 or 7 is known as the modulus (and modulo is Latin for “by the modulus”).

5 + 4 = 9 → 9 / 12 = 0*12 + 9

(5 + 4) modulo 12 = 9


3 + 8 + 1 = 12 → 12 / 12 = 1*12 + 0

(3 + 8 + 1) modulo 12 = 0


19 / 12 = 1*12 + 7

19 mod 12 = 7


3 + 1 = 4 → 4 / 7 = 0*7 + 4

(3 + 1) mod 7 = 4


2 + 4 + 1 = 7 → 7 / 7 = 1*7 + 0

(2 + 4 + 1) mod 7 = 0


19 / 7 = 2*7 + 5

19 mod 7 = 5


Modular arithmetic can do wonderful things. One small but beautiful example is the way it can uncover hidden fractals in Pascal’s triangle:

Pascal’s Triangle (via Desmos)


How to create Pascal’s triangle (via Wikipedia)


If you color all numbers n mod 2 = 1 (i.e., odd numbers) in the triangle, they create the famous Sierpiński triangle:

The Sierpiński triangle in Pascal’s triangle (via Fractal Foundation)

Pascal’s triangle, n mod 2 = 1 (click for larger)


The Sierpiński triangle appears like this for all n mod 4 = 2 in Pascal’s triangle:

Pascal’s triangle, n mod 4 = 2 (click for larger)


And so on:

Pascal’s triangle, n mod 8 = 4


Pascal’s triangle, n mod 16 = 8


Pascal’s triangle, n mod 32 = 16


Pascal’s triangle, n mod 64 = 32


Pascal’s triangle, n mod 128 = 64


Pascal’s triangle, n mod 256 = 128


Pascal’s triangle, n mod 2,4,8… = 1,2,4… (animated via EzGif)


Post-Performative Post-Scriptum

There’s no need to calculate Pascal’s triangle in full to find the fractals above. The 10th row of Pascal’s triangle is this:

1, 10, 45, 120, 210, 252, 210, 120, 45, 10, 1

The 20th row is this:

1, 20, 190, 1140, 4845, 15504, 38760, 77520, 125970, 167960, 184756, 167960, 125970, 77520, 38760, 15504, 4845, 1140, 190, 20, 1

And the 29th is this:

1, 29, 406, 3654, 23751, 118755, 475020, 1560780, 4292145, 10015005, 20030010, 34597290, 51895935, 67863915, 77558760, 77558760, 67863915, 51895935, 34597290, 20030010, 10015005, 4292145, 1560780, 475020, 118755, 23751, 3654, 406, 29, 1

But you don’t need to consider those ever-growing numbers in the triangle when you’re finding fractals with modular arithmetic. When the modulus is 2, you just work with 0 and 1, that is, you add the previous numbers in the triangle and find the sum modulo 2. When the modulus is 4, you just work with 0, 1, 2 and 3, adding the numbers and finding the sum modulo 4. When it’s 8, you just work with 0, 1, 2, 3, 4, 5, 6 and 7, finding the sum modulo 8. And so on.