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

You Sixy Beast

666 is the Number of the Beast. But it’s much more than that. After all, it’s a number, so it has mathematical properties (everything has mathematical properties, but it’s a sine-qua-non of numbers). For example, 666 is a palindromic number, reading the same forwards and backwards. And it’s a repdigit, consisting of a single repeated digit. Now try answering this question: how many pebbles are there in this triangle?



••
•••
••••
•••••
••••••
•••••••
••••••••
•••••••••
••••••••••
•••••••••••
••••••••••••
•••••••••••••
••••••••••••••
•••••••••••••••
••••••••••••••••
•••••••••••••••••
••••••••••••••••••
•••••••••••••••••••
••••••••••••••••••••
•••••••••••••••••••••
••••••••••••••••••••••
•••••••••••••••••••••••
••••••••••••••••••••••••
•••••••••••••••••••••••••
••••••••••••••••••••••••••
•••••••••••••••••••••••••••
••••••••••••••••••••••••••••
•••••••••••••••••••••••••••••
••••••••••••••••••••••••••••••
•••••••••••••••••••••••••••••••
••••••••••••••••••••••••••••••••
•••••••••••••••••••••••••••••••••
••••••••••••••••••••••••••••••••••
•••••••••••••••••••••••••••••••••••
••••••••••••••••••••••••••••••••••••


Counting the pebbles one by one would take a long time, but there’s a short-cut. Each line of the triangle after the first is one pebble longer than the previous line. There are 36 lines and therefore 36 pebbles in the final line. So the full number of pebbles = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36. And there’s an easy formula for that sum: (36^2 + 36) / 2 = (1296 + 36) / 2 = 1332 / 2 = 666.

So 666 is the 36th triangular number:


1 = 1
1+2 = 3
1+2+3 = 6
1+2+3+4 = 10
1+2+3+4+5 = 15
1+2+3+4+5+6 = 21
1+2+3+4+5+6+7 = 28
1+2+3+4+5+6+7+8 = 36
1+2+3+4+5+6+7+8+9 = 45
1+2+3+4+5+6+7+8+9+10 = 55
[...]
1+2+3+4+5+6+7+8+9+10+11+12+13+14+15+16+17+18+19+20+21+22+23+24+25+26+27+28+29+30+31+32+33+34+35+36 = 666

But what’s tri(666), the 666th triangular number? By the formula above, it equals (666^2 + 666) / 2 = (443556 + 666) / 2 = 444222 / 2 = 222111. But recall something else from above: tri(6) = 1+2+3+4+5+6 = 21. Is it a coincidence that tri(6) = 21 and tri(666) = 222111? No, it isn’t:


tri(6) = 21 = (6^2 + 6) / 2 = (36 + 6) / 2 = 42 / 2
tri(66) = 2211 = (66^2 + 66) / 2 = (4356 + 66) / 2 = 4422 / 2
tri(666) = 222111 = (666^2 + 666) / 2 = (443556 + 666) / 2 = 444222 / 2
tri(6666) = 22221111
tri(66666) = 2222211111
tri(666666) = 222222111111
tri(6666666) = 22222221111111
tri(66666666) = 2222222211111111
tri(666666666) = 222222222111111111
tri(6666666666) = 22222222221111111111
tri(66666666666) = 2222222222211111111111
tri(666666666666) = 222222222222111111111111
tri(6666666666666) = 22222222222221111111111111
tri(66666666666666) = 2222222222222211111111111111
tri(666666666666666) = 222222222222222111111111111111

So we’ve looked at tri(36) = 666 and tri(666) = 222111. Let’s go a step further: tri(222111) = 24666759216. So 666 appears again. And the sixiness carries on here:


tri(36) = 666
tri(3366) = 5666661
tri(333666) = 55666666611
tri(33336666) = 555666666666111
tri(3333366666) = 5555666666666661111
tri(333333666666) = 55555666666666666611111
tri(33333336666666) = 555555666666666666666111111
tri(3333333366666666) = 5555555666666666666666661111111
tri(333333333666666666) = 55555555666666666666666666611111111
tri(33333333336666666666) = 555555555666666666666666666666111111111
tri(3333333333366666666666) = 5555555555666666666666666666666661111111111
tri(333333333333666666666666) = 55555555555666666666666666666666666611111111111
tri(33333333333336666666666666) = 555555555555666666666666666666666666666111111111111
tri(3333333333333366666666666666) = 5555555555555666666666666666666666666666661111111111111
tri(333333333333333666666666666666) = 55555555555555666666666666666666666666666666611111111111111

The Devil’s Digits

As I’ve said before, I love the way that numbers can come in many different guises. For example, take the number 21. It comes in all these guises:

21 = 10101 in base 2 = 210 in base 3 = 111 in b4 = 41 in b5 = 33 in b6 = 30 in b7 = 25 in b8 = 23 in b9 = 21 in b10 = 1A in b11 = 19 in b12 = 18 in b13 = 17 in b14 = 16 in b15 = 15 in b16 = 14 in b17 = 13 in b18 = 12 in b19 = 11 in b20 = 10 in b21

But I’ve not chosen 21 at random. If you sum the 1s in the representations of 21 in bases 2 to 21, look what you get:

21 = 10101 in base 2 = 210 in base 3 = 111 in b4 = 41 in b5 = 33 in b6 = 30 in b7 = 25 in b8 = 23 in b9 = 21 in b10 = 1A in b11 = 19 in b12 = 18 in b13 = 17 in b14 = 16 in b15 = 15 in b16 = 14 in b17 = 13 in b18 = 12 in b19 = 11 in b20 = 10 in b21


21 = 1s=101s=201s=3 in base 2 = 21s=40 in base 3 = 111s=7 in b4 = 41s=8 in b5 = 33 in b6 = 30 in b7 = 25 in b8 = 23 in b9 = 21s=9 in b10 = 1s=10A in b11 = 1s=119 in b12 = 1s=128 in b13 = 1s=137 in b14 = 1s=146 in b15 = 1s=155 in b16 = 1s=164 in b17 = 1s=173 in b18 = 1s=182 in b19 = 11s=20 in b20 = 1s=210 in b21


In other words, 21 = digcount(21,dig=1,base=2..21). But n = digcount(n,dig,b=2..n) doesn’t happen for any other digit and doesn’t happen often with 1:

3 = digcount(3,d=1,b=2..3) = 11 in b2 = 10 in b3
4 = digcount(4,d=1,b=2..4) = 100 in b2 = 11 in b3 = 10 in b4
6 = digcount(6,d=1,b=2..6) = 110 in b2 = 20 in b3 = 12 in b4 = 11 in b5 = 10 in b6
10 = digcount(10,d=1) = 1010 in b2 = 101 in b3 = 22 in b4 = 20 in b5 = 14 in b6 = 13 in b7 = 12 in b8 = 11 in b9 = 10 in b10
15 = digcount(15,d=1) = 1111 in b2 = 120 in b3 = 33 in b4 = 30 in b5 = 23 in b6 = 21 in b7 = 17 in b8 = 16 in b9 = 15 in b10 = 14 in b11 = 13 in b12 = 12 in b13 = 11 in b14 = 10 in b15
21 = digcount(21,d=1) = 10101 in b2 = 210 in b3 = 111 in b4 = 41 in b5 = 33 in b6 = 30 in b7 = 25 in b8 = 23 in b9 = 21 in b10 = 1A in b11 = 19 in b12 = 18 in b13 = 17 in b14 = 16 in b15 = 15 in b16 = 14 in b17 = 13 in b18 = 12 in b19 = 11 in b20 = 10 in b21


After that, the digcount(n,d=1,b=2..n) → n/2 (see “Digital Dissection” for further discussion). But I decided to look for the first n where digcount(n,dig,b=2..n) = 666:

digcount(1270,1) = 666
digcount(3770,2) = 666
digcount(7667,3) = 666
digcount(12184,4) = 666
digcount(18845,5) = 666
digcount(25806,6) = 666
digcount(34195,7) = 666
digcount(43352,8) = 666
digcount(54693,9) = 666


It doesn’t stop there, of course. You can carry on for ever, looking for digcount(n,A) = 666, digcount(n,B) = 666, digcount(n,C) = 666, where A = 10, B = 11 and C=12, and so on. But it doesn’t start there, either. What about digcount(n,0) = 666? That isn’t easy to find, because 0 usually occurs far less often than other digits in the representation of n. Here are the integers setting records for digcount(n,0,b=2..n):

2 → digcount(2,0) = 1 ← 2= 10 in base 2
4 → digcount(4,0) = 3; ← 4 = 100 in base 2, 11 in base 3, 10 in base 4
8 → digcount(8,0) = 5 ← 8 = 1000 in base 2, 22 in base 3, 20 in base 4, 13 in base 5, 12 in base 6, 11 in base 7, 10 in base 8
12 → digcount(12,0) = 6
16 → digcount(16,0) = 8
18 → digcount(18,0) = 9
32 → digcount(32,0) = 11
36 → digcount(36,0) = 13
64 → digcount(64,0) = 15
72 → digcount(72,0) = 18
128 → digcount(128,0) = 20
144 → digcount(144,0) = 24
252 → digcount(252,0) = 25
264 → digcount(264,0) = 27
288 → digcount(288,0) = 29
360 → digcount(360,0) = 30
504 → digcount(504,0) = 33
540 → digcount(540,0) = 36
720 → digcount(720,0) = 40
900 → digcount(900,0) = 42
1080 → digcount(1080,0) = 47
1680 → digcount(1680,0) = 48
1800 → digcount(1800,0) = 53
2160 → digcount(2160,0) = 56
2520 → digcount(2520,0) = 61
3600 → digcount(3600,0) = 64
4320 → digcount(4320,0) = 66


So what is the first n for which digcount(n,0) = 666? Watch this space.