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


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

The Number of the Creased

Here’s an idea for a story à la M.R. James. A middle-aged scholar opens some mail one morning and finds nothing inside one envelope but a strip of paper with the numbers 216348597 written on it in sinister red ink. Someone has folded the strip several times so that there are creases between groups of numbers, like this: 216|348|5|97. Wondering what the significance of the creases is, the scholar hits on the step of adding the numbers created by them:


216 + 348 + 5 + 97 = 666

After that… Well, I haven’t written the story yet. But that beginning raises an obvious question. Is there any other way of getting a Number of the Creased from 216348597? That is, can you get 666, the Number of the Beast, by dividing 216348597 in another way? Yes, you can. In fact, there are six ways of creating 666 by dividing-and-summing 216348597:


666 = 2 + 1 + 634 + 8 + 5 + 9 + 7
666 = 2 + 163 + 485 + 9 + 7
666 = 216 + 348 + 5 + 97
666 = 21 + 63 + 485 + 97
666 = 21 + 6 + 34 + 8 + 597
666 = 2 + 16 + 3 + 48 + 597


216348597 is a permutation of 123456789, so does 123456789 yield a Number of the Creased? Yes. Two of them, in fact:


666 = 123 + 456 + 78 + 9
666 = 1 + 2 + 3 + 4 + 567 + 89


And 987654321 yields another:


666 = 9 + 87 + 6 + 543 + 21


And what about other permutations of 123456789? These are the successive records:

Using 123456789

666 = 123 + 456 + 78 + 9
666 = 1 + 2 + 3 + 4 + 567 + 89 (c=2)


Using 123564789

666 = 12 + 3 + 564 + 78 + 9
666 = 123 + 56 + 478 + 9
666 = 1 + 2 + 3 + 564 + 7 + 89 (c=3)


Using 125463978

666 = 1 + 2 + 5 + 4 + 639 + 7 + 8
666 = 12 + 546 + 3 + 97 + 8
666 = 1 + 254 + 6 + 397 + 8
666 = 1 + 2 + 546 + 39 + 78 (c=4)


Using 139462578

666 = 13 + 9 + 4 + 625 + 7 + 8
666 = 139 + 462 + 57 + 8
666 = 1 + 394 + 6 + 257 + 8
666 = 1 + 39 + 46 + 2 + 578
666 = 13 + 9 + 4 + 62 + 578 (c=5)


Using 216348597

666 = 2 + 1 + 634 + 8 + 5 + 9 + 7
666 = 2 + 163 + 485 + 9 + 7
666 = 216 + 348 + 5 + 97
666 = 21 + 63 + 485 + 97
666 = 21 + 6 + 34 + 8 + 597
666 = 2 + 16 + 3 + 48 + 597 (c=6)



216348597 is the best of the bestial. No other permutation of 123456789 yields as many as six Numbers of the Creased.

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.

Year and Square

The simplest and in some ways greatest magic square is this:

6 1 8
7 5 3
2 9 4 (Magic total = 15)

All rows and columns sum to 15 and so do both diagonals. Using other sets of numbers, you can create an infinite number of further 3×3 magic squares. Here’s one using only prime numbers and 1:

43 01 67
61 37 13
07 73 31 (Magic=111)

The magic total is 111, which is 3 x 37, just as 15 = 3 x 5. It’s an interesting but untaxing exercise to prove that, for all 3×3 magic squares, the magic total is three times the central number. So you can use only prime numbers in a 3×3 square, but you can’t have a prime number as the magic total (unless you use fractions and so on).

And guess what? 2019 = 3 x 667, the first prime number after 666. So I decided to see if I could find an all-prime magic squares whose magic total was 2019. I found nine of them (and 9 = 3 x 3).

1117 0019 0883
0439 0673 0907
0463 1327 0229 (Magic=2019)

1069 0067 0883
0487 0673 0859
0463 1279 0277 (Magic=2019)

1063 0229 0727
0337 0673 1009
0619 1117 0283 (Magic=2019)

0883 0313 0823
0613 0673 0733
0523 1033 0463 (Magic=2019)

0619 0337 1063
1117 0673 0229
0283 1009 0727 (Magic=2019)

0463 0439 1117
1327 0673 0019
0229 0907 0883 (Magic=2019)

0463 0487 1069
1279 0673 0067
0277 0859 0883 (Magic=2019)

0379 0607 1033
1327 0673 0019
0313 0739 0967 (Magic=2019)

0523 0613 0883
1033 0673 0313
0463 0733 0823 (Magic=2019)

DeVil to Power

666 is the Number of the Beast described in the Book of Revelation:

13:18 Here is wisdom. Let him that hath understanding count the number of the beast: for it is the number of a man; and his number is Six hundred threescore and six.

But 666 is not just diabolic: it’s narcissistic too. That is, it mirrors itself using arithmetic, like this:

666^47 =

5,049,969,684,420,796,753,173,148,798,405,
  564,772,941,516,295,265,408,188,117,632,
  668,936,540,446,616,033,068,653,028,889,
  892,718,859,670,297,563,286,219,594,665,
  904,733,945,856 → 5 + 0 + 4 + 9 + 9 + 6 + 9 + 6 + 8 + 4 + 4 + 2 + 0 + 7 + 9 + 6 + 7 + 5 + 3 + 1 + 7 + 3 + 1 + 4 + 8 + 7 + 9 + 8 + 4 + 0 + 5 + 5 + 6 + 4 + 7 + 7 + 2 + 9 + 4 + 1 + 5 + 1 + 6 + 2 + 9 + 5 + 2 + 6 + 5 + 4 + 0 + 8 + 1 + 8 + 8 + 1 + 1 + 7 + 6 + 3 + 2 + 6 + 6 + 8 + 9 + 3 + 6 + 5 + 4 + 0 + 4 + 4 + 6 + 6 + 1 + 6 + 0 + 3 + 3 + 0 + 6 + 8 + 6 + 5 + 3 + 0 + 2 + 8 + 8 + 8 + 9 + 8 + 9 + 2 + 7 + 1 + 8 + 8 + 5 + 9 + 6 + 7 + 0 + 2 + 9 + 7 + 5 + 6 + 3 + 2 + 8 + 6 + 2 + 1 + 9 + 5 + 9 + 4 + 6 + 6 + 5 + 9 + 0 + 4 + 7 + 3 + 3 + 9 + 4 + 5 + 8 + 5 + 6 = 666

666^51 =

993,540,757,591,385,940,334,263,511,341,
295,980,723,858,637,469,431,008,997,120,
691,313,460,713,282,967,582,530,234,558,
214,918,480,960,748,972,838,900,637,634,
215,694,097,683,599,029,436,416 → 9 + 9 + 3 + 5 + 4 + 0 + 7 + 5 + 7 + 5 + 9 + 1 + 3 + 8 + 5 + 9 + 4 + 0 + 3 + 3 + 4 + 2 + 6 + 3 + 5 + 1 + 1 + 3 + 4 + 1 + 2 + 9 + 5 + 9 + 8 + 0 + 7 + 2 + 3 + 8 + 5 + 8 + 6 + 3 + 7 + 4 + 6 + 9 + 4 + 3 + 1 + 0 + 0 + 8 + 9 + 9 + 7 + 1 + 2 + 0 + 6 + 9 + 1 + 3 + 1 + 3 + 4 + 6 + 0 + 7 + 1 + 3 + 2 + 8 + 2 + 9 + 6 + 7 + 5 + 8 + 2 + 5 + 3 + 0 + 2 + 3 + 4 + 5 + 5 + 8 + 2 + 1 + 4 + 9 + 1 + 8 + 4 + 8 + 0 + 9 + 6 + 0 + 7 + 4 + 8 + 9 + 7 + 2 + 8 + 3 + 8 + 9 + 0 + 0 + 6 + 3 + 7 + 6 + 3 + 4 + 2 + 1 + 5 + 6 + 9 + 4 + 0 + 9 + 7 + 6 + 8 + 3 + 5 + 9 + 9 + 0 + 2 + 9 + 4 + 3 + 6 + 4 + 1 + 6 = 666

But those are tiny numbers compared to 6^(6^6). That means 6^46,656 and equals roughly 2·6591… x 10^36,305. It’s 36,306 digits long and its full digit-sum is 162,828. However, 666 lies concealed in those digits too. To see how, consider the function Σ(x1,xn), which returns the sum of digits 1 to n of x. For example, π = 3·14159265…, so Σ(π14) = 3 + 1 + 4 + 1 = 9. The first 150 digits of 6^(6^6) are these:

26591197721532267796824894043879185949053422002699
24300660432789497073559873882909121342292906175583
03244068282650672342560163577559027938964261261109
… (150 digits)

If x = 6^(6^6), then Σ(x1,x146) = 666, Σ(x2,x148) = 666, and Σ(x2,x149) = 666.

There’s nothing special about these patterns: infinitely many numbers are narcissistic in similar ways. However, 666 has a special cultural significance, so people pay it more attention and look for patterns related to it more carefully. Who cares, for example, that 667 = digit-sum(667^48) = digit-sum(667^54) = digit-sum(667^58)? Fans of recreational maths will, but not very much. The Number of the Beast is much more fun, narcissistically and otherwise:

666 = digit-sum(6^194)
666 = digit-sum(6^197)

666 = digit-sum(111^73)
666 = digit-sum(111^80)

666 = digit-sum(222^63)
666 = digit-sum(222^66)

666 = digit-sum(333^58)
666 = digit-sum(444^53)
666 = digit-sum(777^49)
666 = digit-sum(999^49)


Previously pre-posted (please peruse):

More Narcissisum
Digital Disfunction
The Hill to Power
Narcissarithmetic #1
Narcissarithmetic #2

Digital Disfunction

It’s fun when functions disfunc. The function digit-sum(n^p) takes a number, raises it to the power of p and sums its digits. If p = 1, n is unchanged. So digit-sum(1^1) = 1, digit-sum(11^1) = 2, digit-sum(2013^1) = 6. The following numbers set records for the digit-sum(n^1) from 1 to 1,000,000:

digit-sum(n^1): 1, 2, 3, 4, 5, 6, 7, 8, 9, 19, 29, 39, 49, 59, 69, 79, 89, 99, 199, 299, 399, 499, 599, 699, 799, 899, 999, 1999, 2999, 3999, 4999, 5999, 6999, 7999, 8999, 9999, 19999, 29999, 39999, 49999, 59999, 69999, 79999, 89999, 99999, 199999, 299999, 399999, 499999, 599999, 699999, 799999, 899999, 999999.

The pattern is easy to predict. But the function disfuncs when p = 2. Digit-sum(3^2) = 9, which is more than digit-sum(4^2) = 1 + 6 = 7 and digit-sum(5^2) = 2 + 5 = 7. These are the records from 1 to 1,000,000:

digit-sum(n^2): 1, 2, 3, 7, 13, 17, 43, 63, 83, 167, 264, 313, 707, 836, 1667, 2236, 3114, 4472, 6833, 8167, 8937, 16667, 21886, 29614, 32617, 37387, 39417, 42391, 44417, 60663, 63228, 89437, 141063, 221333, 659386, 791833, 976063, 987917.

Higher powers are similarly disfunctional:

digit-sum(n^3): 1, 2, 3, 4, 9, 13, 19, 53, 66, 76, 92, 132, 157, 353, 423, 559, 842, 927, 1192, 1966, 4289, 5826, 8782, 10092, 10192, 10275, 10285, 10593, 11548, 11595, 12383, 15599, 22893, 31679, 31862, 32129, 63927, 306842, 308113.

digit-sum(n^4): 1, 2, 3, 4, 6, 8, 13, 16, 18, 23, 26, 47, 66, 74, 118, 256, 268, 292, 308, 518, 659, 1434, 1558, 1768, 2104, 2868, 5396, 5722, 5759, 6381, 10106, 12406, 14482, 18792, 32536, 32776, 37781, 37842, 47042, 51376, 52536, 84632, 255948, 341156, 362358, 540518, 582477.

digit-sum(n^5): 1, 2, 3, 5, 6, 14, 15, 18, 37, 58, 78, 93, 118, 131, 139, 156, 179, 345, 368, 549, 756, 1355, 1379, 2139, 2759, 2779, 3965, 4119, 4189, 4476, 4956, 7348, 7989, 8769, 9746, 10566, 19199, 19799, 24748, 31696, 33208, 51856, 207198, 235846, 252699, 266989, 549248, 602555, 809097, 814308, 897778.

You can also look for narcissistic numbers with this function, like digit-sum(9^2) = 8 + 1 = 9 and digit-sum(8^3) = 5 + 1 + 2 = 8. 9^2 is the only narcissistic square in base ten, but 8^3 has these companions:

17^3 = 4913 → 4 + 9 + 1 + 3 = 17
18^3 = 5832 → 5 + 8 + 3 + 2 = 18
26^3 = 17576 → 1 + 7 + 5 + 7 + 6 = 26
27^3 = 19683 → 1 + 9 + 6 + 8 + 3 = 27

Twelfth powers are as unproductive as squares:

108^12 = 2518170116818978404827136 → 2 + 5 + 1 + 8 + 1 + 7 + 0 + 1 + 1 + 6 + 8 + 1 + 8 + 9 + 7 + 8 + 4 + 0 + 4 + 8 + 2 + 7 + 1 + 3 + 6 = 108

But thirteenth powers are fertile:

20 = digit-sum(20^13)
40 = digit-sum(40^13)
86 = digit-sum(86^13)
103 = digit-sum(103^13)
104 = digit-sum(104^13)
106 = digit-sum(106^13)
107 = digit-sum(107^13)
126 = digit-sum(126^13)
134 = digit-sum(134^13)
135 = digit-sum(135^13)
146 = digit-sum(146^13)

There are also numbers that are narcissistic with different powers, like 90:

90^19 = 1·350851717672992089 x 10^37 → 1 + 3 + 5 + 0 + 8 + 5 + 1 + 7 + 1 + 7 + 6 + 7 + 2 + 9 + 9 + 2 + 0 + 8 + 9 = 90
90^20 = 1·2157665459056928801 x 10^39 → 1 + 2 + 1 + 5 + 7 + 6 + 6 + 5 + 4 + 5 + 9 + 0 + 5 + 6 + 9 + 2 + 8 + 8 + 0 + 1 = 90
90^21 = 1·09418989131512359209 x 10^41 → 1 + 0 + 9 + 4 + 1 + 8 + 9 + 8 + 9 + 1 + 3 + 1 + 5 + 1 + 2 + 3 + 5 + 9 + 2 + 0 + 9 = 90
90^22 = 9·84770902183611232881 x 10^42 → 9 + 8 + 4 + 7 + 7 + 0 + 9 + 0 + 2 + 1 + 8 + 3 + 6 + 1 + 1 + 2 + 3 + 2 + 8 + 8 + 1 = 90
90^28 = 5·23347633027360537213511521 x 10^54 → 5 + 2 + 3 + 3 + 4 + 7 + 6 + 3 + 3 + 0 + 2 + 7 + 3 + 6 + 0 + 5 + 3 + 7 + 2 + 1 + 3 + 5 + 1 + 1 + 5 + 2 + 1 = 90

One of the world’s most famous numbers is also multi-narcissistic:

666 = digit-sum(666^47)
666 = digit-sum(666^51)

1423 isn’t multi-narcissistic, but I like the way it’s a prime that’s equal to the sum of the digits of its power to 101, which is also a prime:

1423^101 = 2,
976,424,759,070,864,888,448,625,568,610,774,713,351,233,339,
006,775,775,271,720,934,730,013,444,193,709,672,452,482,197,
898,160,621,507,330,824,007,863,598,230,100,270,989,373,401,
979,514,790,363,102,835,678,646,537,123,754,219,728,748,171,
764,802,617,086,504,534,229,621,770,717,299,909,463,416,760,
781,260,028,964,295,036,668,773,707,186,491,056,375,768,526,
306,341,717,666,810,190,220,650,285,746,057,099,312,179,689,
423 →

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


Previously pre-posted (please peruse):

The Hill to Power
Narcissarithmetic #1
Narcissarithmetic #2

Sumbertime Views

Like 666 (see Revelation 13:18), 153 (see John 21:11) appears in the Bible. And perhaps for the same reason: because it is the sum of successive integers. 153 = 1+2+3+…+17 = Σ(17), just as 666 = Σ(36). So both numbers are sum-numbers or sumbers. But 153 has other interesting properties, including one that can’t have been known in Biblical times, because numbers weren’t represented in the right way. It’s also the sum of the cubes of its digits: 153 = 1^3 + 5^3 + 3^3 = 1 + 125 + 27. So 153 is a cube-sumber or 3-sumber. The other 3-sumbers are 370, 371 and 407. There are 4-sumbers too, like 1,634 = 1^4 + 6^4 + 3^4 + 4^4, and 5-sumbers, like 194,979 = 1^5 + 9^5 + 4^5 + 9^5 + 7^5 + 9^5, and 6-sumbers, like 548,834 = 5^6 + 4^6 + 8^6 + 8^6 + 3^6 + 4^6.

But there are no 2-sumbers, or numbers that are the sum of the squares of their digits. It doesn’t take long to confirm this, because numbers above a certain size can’t be 2-sumbers. 9^2 + 9^2 = 162, but 9^2 + 9^2 + 9^2 = 243. So 2-sumbers can’t exist above 99 and if you search that high you’ll find that they don’t exist at all. At least not in this house, but they do exist in the houses next door. Base 10 yields nothing, so what about base 9?

4^2 + 5^2 = 45[9] = 41[10]
5^2 + 5^2 = 55[9] = 50

And base 11?

5^2 + 6^2 = 56[11] = 61[10]
6^2 + 6^2 = 66[11] = 72

This happens because odd bases always yield a pair of 2-sumbers whose second digit is one more than half the base and whose first digit is the same or one less. See above (and the appendix). Such a pair is found among the 14 sumbers of base 47, which is the best total till base 157 and its 22 sumbers. Here are the 2-sumbers for base 47:

2^2 + 10^2 = 104
3^2 + 12^2 = 153
5^2 + 15^2 = 250
9^2 + 19^2 = 442
12^2 + 21^2 = 585
14^2 + 22^2 = 680
23^2 + 24^2 = 1,105
24^2 + 24^2 = 1,152
33^2 + 22^2 = 1,573
35^2 + 21^2 = 1,666
38^2 + 19^2 = 1,805
42^2 + 15^2 = 1,989
44^2 + 12^2 = 2,080
45^2 + 10^2 = 2,125

As the progressive records for 2-sumber-totals are set, subsequent bases seem to either match or surpass them, except in three cases below base 450:

2 in base 5
4 in base 7
6 in base 13
10 in base 43
14 in base 47
22 in base 157
8 in base 182*
16 in base 268*
30 in base 307
18 in base 443*

Totals for sums of squares in bases 4 to 450

Totals for sums-of–squares in bases 4 to 450 (click for larger image)

Appendix: Odd Bases and 2-sumbers

Take an even number and half of that even number: say 12 and 6. 12 x 6 = 11 x 6 + 6. Further, 12 x 6 = 2 x 6 x 6 = 2 x 6^2 = 6^2 + 6^2. Accordingly, 66[11] = 6 x 11 + 6 = 12 x 6 = 6^2 + 6^2. So 66 in base 11 is a 2-sumber. Similar reasoning applies to every other odd base except base-3 [update: wrong!]. Now, take 12 x 5 = 2 x 6 x 5 = 2 x (5×5 + 5) = 5^2+5 + 5^5+5 = 5^5 + 5^5+2×5. Further, 5^5+2×5 = (5+1)(5+1) – 1 = 6^2 – 1. Accordingly, 56[11] = 11×5 + 6 = 12×5 + 1 = 5^2 + 6^2. Again, similar reasoning applies to every other odd base except base-3 [update: no — 1^2 + 2^2 = 12[3] = 5; 2^2 + 2^2 = 22[3] = 8]. This means that every odd base b, except base-3, will supply a pair of 2-sumbers with digits [d-1][d] and [d][d], where d = (b + 1) / 2.