Altars of Mathness

What could be duller than digits? They just sit there on the page or screen, mindlessly marking mathematics:

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, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100…

But perhaps they become more interesting as images. Let’s display the final digit of the integers, or counting numbers, on a graph. Running left-right and up-down, the graph represents the final or rightmost digit of 1, 2, 3, … 10, 11, 12, 13, … 100, 101, 102, 103, …, 1000, 1001, 1002, 1003, …:

Rightmost single digit of the integers (click for larger)


No, that’s still dull: the graph just generates endlessly repeating triangles. After all, the final digits fall into a cycle: 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3… So do the final two digits: 1, 2, 3, 4, 5, […] 94, 95, 96, 97, 98, 99, 00, 01, 02, 03… Here they are as a graph:

Rightmost two digits of the integers


Now the triangles look like waves sweeping to shore. That’s a bit more interesting, but not much. So let’s try something different. The trailing digits of the integers generate triangles, so let’s see what the triangular numbers generate. The triangular numbers — 0, 1, 3, 6, 10, 15, 21… — are very simple to form. You just sum the integers: 1, 3 = 1 + 2, 6 = 1 + 2 + 3, 10 = 1 + 2 + 3 + 4, 15 = 1 + 2 + 3 + 4 + 5, 21 = 1 + 2 + 3 + 4 + 5 + 6, 28 = 1 + 2 + 3 + 4 + 5 + 6 + 7, 36 = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8, 45 = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9, 55 = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10… Here are the final digits of the triangulars — 1, 3, 6, 0, 5, 1, 8, 6… — as a graph:

Final digit of triangular numbers in base 10 (click for larger)


Now something interesting has appeared. The final digits form a repeated palindromic pattern (counting 0 as the zero-th triangular number):

0, 1, 3, 6, 0, 5, 1, 8, 6, 5, 5, 6, 8, 1, 5, 0, 6, 3, 1, 0, 0, 1, 3, 6, 0, 5, 1, 8, 6, 5, 5, 6, 8, 1, 5, 0, 6, 3, 1, 0, 0, 1, 3, 6, 0, 5, 1, 8, 6, 5, 5, 6, 8, 1, 5, 0, 6, 3, 1, 0, 0, 1, 3, 6, 0, 5, 1, 8, 6, 5, 5, 6, 8, 1, 5, 0, 6, 3, 1, 0, …

An Altar of Mathness created by the final digit of triangular numbers in base 10


And those palindromic digits create symmetric shapes that remind me of little altars — let’s call them “altars of mathness” in tribute to Morbid Angel’s genre-defining album Altars of Madness (1989). And what about the final two digits of the triangular numbers? Here’s the graph (adjusted so that 99 fits into the same space as 9):

Final two digits of triangulars in b10


Final two triangular digits in b10 (horizontal scale compressed)


The final two digits form palindromes too. And this time we don’t get just triangles, but curves too. But that’s in base 10. What happens with the trailing triangular digits in other bases? Well, here’s the final triangular digit creating more altars of mathness in different bases (note that the altars are more elaborate in even bases):

Final triangular digit in base 4


Final triangular digit in b5


Final triangular digit in b6


Final triangular digit in b7


Final triangular digit in b8


Final triangular digit in b9


Final triangular digit in b14


And here’s the graph for the final triangular digit in base 100:

Final triangular digit in b100


The graph for final single digit in b100 should look familiar, because it’s identical to the graph for final double triangular digits in b10:

Final two digits of triangulars in b10


That’s because two digits in b10 are equivalent in one digit in b100, four digits in b10 are equivalent to two digits in b100, and so on. But b100 can’t capture three digits in b10 (the graph is again adjusted so that 999 fits into the same space as 9 and 99 above):

Final three triangular digits in b10


If you compress the x-axis for that graph, you can see how long the symmetries are:

Final three triangular digits in b10 (x-axis / 2)


Final three triangular digits in b10 (x-axis / 4)


The final four digits of the triangulars in b10 create even longer symmetries:

Final quadruple triangular digits in b10


Final quadruple triangular digits in b10 (x-axis / 2)


Final quadruple triangular digits in b10 (x-axis / 8)


Note how, as the length of the final digits rises, you need to compress the x-axis more and more to see the symmetries. But integer sequences obviously don’t end with the counting numbers and triangulars. What about squares and powers of n? What about primes and Fibonacci numbers? Here’s the final two digits of the squares — 1, 4, 9, 16, 25, 49, 64, 81, 100, 121, 144, 169… — in b10:

Final two digits of the squares in b10


It’s reminiscent of the triangular numbers (so are the final-digit graphs for other polygonal numbers). So what about the powers of 2? That’s 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024… Here’s the graph for final single digits of 2^p in b10:

Final single digits of 2^p in b10


This time there’s repetition, but not symmetry. Here’s the graph for final double digits, or 2-digits, of 2^p in b10:

Final 2-dig of 2^p in b10


Now the graph looks a little like a range of eroded mountains. Now try dig-4, the final four digits of 2^p in b10:

Final 4-dig of 2^p in b10


The patterns are similar to those of dig-2 and don’t need compressing in the x-axis. This similarity and lack of need for compression are true of any number of final digits in 2^p. The final 10 digits look like this:

Final 10-dig of 2^p in b10


And the final 20 and 30 digits like this:

Final 20-dig of 2^p in b10


Final 30-dig of 2^p in b10


Powers don’t behave like polygonals: the finals are fractals. That is, the final digits create similar patterns at all scales: 1-dig, 2-dig, 10-dig, 100-dig, 1000-dig and so on. That’s true in other bases:

Final 5-dig of 3^p in b2


But a glimpse of b2 is all you’re going to get of other bases. There are other fish to fry — Fibonacci fish. The Fibonacci sequence, whose terms are equal to the sum of the previous two numbers (after seeding with “1, 1”), starts like this: 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… And what about the graphs for final fib-digits? As you’ll see, final Fib-digits are fractal too. Indeed, Fibonacci final-graphs look like 2-power final-graphs (in a way, Fibonacci numbers are powers of φ = 1.6180339887498948482…). The patterns are similar at all scales. And they remind me of the skyline of a ruined city in an Oriental tale, with collapsed domes and crumbling minarets:

Final 1-dig of Fibonacci numbers in b10


Final 2-fibdig in b10


Final 3-fibdig in b10


Final 4-fibdig in b10


Final 5-fibdig in b10


Final 10-fibdig in b10


Final 15-fibdig in b10


Final 20-fibdig in b10


Final 25-fibdig in b10


So final fibdigs are fractal. But final prime digits aren’t:

Final 1-digit of primes in b10


Final 1-digit of primes in b5


Final 2-digit of primes in b10


Primes aren’t final-digitally fractal like Fibonaccis and powers of 2. But there’s occasional symmetry in the prime fin-digs. I’ve marked some palindromic patterns in red and green:

Palindromic patterns in final 1-digits of the primes in b10 (click for larger)


The palindromic patterns, or pal-pats, in the primes look like the altars of mathness in the triangulars. They’re created by digital palindromes like these:

19, 23, 29 (c=3)
347, 349, 353, 359, 367 (c=5)
937, 941, 947, 953, 967, 971, 977 (c=7)
1951, 1973, 1979, 1987, 1993, 1997, 1999, 2003, 2011 (c=9)
26423, 26431, 26437, 26449, 26459, 26479, 26489, 26497, 26501, 26513 (c=10)


Here are the first few pal-pats in the primes (note that 157, 163, 167 and 163, 167, 173 overlap):

2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607…

And are there palindromes among the final 2-digits, 3-digits and higher n-digits of the primes in different bases? Yes, you can easily find some. But I haven’t put them on a graph yet:

Base 10 (2-dig)

58789, 58831, 58889 (c=3)
286873, 286927, 286973 (c=3)
360649, 360653, 360749 (c=3)
404851, 404941, 404951 (c=3)
590437, 590489, 590537 (c=3)
623071, 623107, 623171 (c=3)
651517, 651587, 651617 (c=3)


Base 6 (2-dig)

300335, 300401, 300441, 300501, 300535 (c=5) (23459 to 23531 in base 10)
1030255, 1030331, 1030351, 1030431, 1030455 (c=5) (50651 to 50723 in b10)
1140451, 1140501, 1140521, 1141001, 1141051 (c=5) (59791 to 59863 in b10)
1402451, 1402545, 1403031, 1403045, 1403051 (c=5) (78367 to 78439 in b10)
1435431, 1435451, 1435505, 1435551, 1440031 (c=5) (82891 to 82963)
2400505, 2401001, 2401015, 2401101, 2401105 (c=5) (124601 to 124673)
2442235, 2442311, 2442351, 2442411, 2442435 (c=5) (130127 to 130199)
2444215, 2444225, 2444311, 2444325, 2444415 (c=5) (130547 to 130619)
2533105, 2533121, 2533215, 2533221, 2533305 (c=5) (136769 to 136841)


Base 4 (3-dig)

20013013, 20013133, 20020013 (c=3) (33223 to 33287 in base 10)
21031111, 21031303, 21032111 (c=3) (37717 to 37781)
22310011, 22310333, 22311011 (c=3) (44293 to 44357)
33030121, 33031001, 33031121 (c=3) (62233 to 62297)
102031333, 102032131, 102032333 (c=3) (74623 to 74687)
110013121, 110013311, 110020121 (c=3) (82393 to 82457)


Base 3 (3-dig)

112121020012, 112121021211, 112121022021, 112121100211, 112121101012 (c=5) (287393 to 287501 in base 10)
202002212002, 202002212101, 202002220001, 202002221101, 202010000002 (c=5) (395741 to 395849)
1001012111212, 1001012112202, 1001012121022, 1001012121202, 1001012122212 (c=5) (555143 to 555251)
1010112112012, 1010112112201, 1010112120222, 1010112121201, 1010112200012 (c=5) (601079 to 601187)
1011202211211, 1011202212212, 1011202220022, 1011202221212, 1011202222211 (c=5) (625369 to 625477)


Base 2 (5-dig)

101110001111101, 101110010000111, 101110010001001, 101110010100111, 101110010111101 (c=5) (23677 to 23741 in base 10)
10000001000111101, 10000001001011001, 10000001001110001, 10000001001111001, 10000001001111101 (c=5) (66109 to 66173)
10111100110011011, 10111100110011111, 10111100110111001, 10111100110111111, 10111100111011011 (c=5) (96667 to 96731)
11010000111110001, 11010001000001101, 11010001000011001, 11010001000101101, 11010001000110001 (c=5) (106993 to 107057)

And I conjecture that you’ll get palindromes for any number of final digits in all bases. And can these palindromes be of arbitrary length? Again, I conjecture so. There are infinitely many primes and very rare patterns can occur infinitely often in an infinite set of numbers.


Post-Performative Post-Scriptum

Here’s Dan Seagrave’s classic cover for Morbid Angel’s Altars of Madness (1989):


Morbid Angel — official website
Dan Seagrave — official website


Elsewhere Other-Accessible…

Formulas Focal to the Flesh — a pre-previous post paronomasizing the title of a Morbid-Angel album…

Moniliform Maths

2 = 1/2 + 2/4 + 3/8 + 4/16 + 5/32…

sum(np / 2n)

2 = prime = sum(n / 2n)
6 = 2·3 = sum(n2 / 2n)
26 = 2·13 = sum(n3 / 2n)
150 = 2·3·52 = sum(n4 / 2n)
1082 = 2·541 = sum(n5 / 2n)
9366 = 2·3·7·223 = sum(n6 / 2n)
94586 = 2·47293 = sum(n7 / 2n)
1091670 = 2·3·5·36389 = sum(n8 / 2n)
14174522 = 2·7087261 = sum(n9 / 2n)
204495126 = 2·3·11·41·75571 = sum(n10 / 2n)

A000629 Number of necklaces of partitions of n+1 labeled beads.

1, 2, 6, 26, 150, 1082, 9366, 94586, 1091670, 14174522, 204495126, 3245265146, 56183135190, 1053716696762, 21282685940886, 460566381955706, 10631309363962710, 260741534058271802, 6771069326513690646, 185603174638656822266, 5355375592488768406230

• moniliform ← French moniliforme (1800 or earlier) ← classical Latin monīle necklace


sum(np / 3n)

3/4 = prime / (22) = sum(n / 3n)
3/2 = prime / prime = sum(n2 / 3n)
33/8 = (3·11) / (23) = sum(n3 / 3n)
15 = 3·5 = sum(n4 / 3n)
273/4 = (3·7·13) / (22) = sum(n5 / 3n)
1491/4 = (3·7·71) / (22) = sum(n6 / 3n)
38001/16 = (3·53·239) / (24) = sum(n7 / 3n)
17295 = 3·5·1153 = sum(n8 / 3n)
566733/4 = (3·188911) / (22) = sum(n9 / 3n)
2579313/2 = (3·11·47·1663) / prime = sum(n10 / 3n)


sum(np / 4n)

4/9 = (22) / (32) = sum(n / 4n)
20/27 = (22·5) / (33) = sum(n2 / 4n)
44/27 = (22·11) / (33) = sum(n3 / 4n)
380/81 = (22·5·19) / (34) = sum(n4 / 4n)
4108/243 = (22·13·79) / (35) = sum(n5 / 4n)
17780/243 = (22·5·7·127) / (35) = sum(n6 / 4n)
269348/729 = (22·172·233) / (36) = sum(n7 / 4n)
4663060/2187 = (22·5·107·2179) / (37) = sum(n8 / 4n)
10091044/729 = (22·2522761) / (36) = sum(n9 / 4n)
218374420/2187 = (22·5·11·23·103·419) / (37) = sum(n10 / 4n)


sum(np / 5n)

5/16 = prime / (24) = sum(n / 5n)
15/32 = (3·5) / (25) = sum(n2 / 5n)
115/128 = (5·23) / (27) = sum(n3 / 5n)
285/128 = (3·5·19) / (27) = sum(n4 / 5n)
3535/512 = (5·7·101) / (29) = sum(n5 / 5n)
26355/1024 = (3·5·7·251) / (210) = sum(n6 / 5n)
458555/4096 = (5·91711) / (212) = sum(n7 / 5n)
1139685/2048 = (3·5·75979) / (211) = sum(n8 / 5n)
25492435/8192 = (5·17·443·677) / (213) = sum(n9 / 5n)
316786305/16384 = (3·5·11·1919917) / (214) = sum(n10 / 5n)


sum(np / 6n)

6/25 = (2·3) / (52) = sum(n / 6n)
42/125 = (2·3·7) / (53) = sum(n2 / 6n)
366/625 = (2·3·61) / (54) = sum(n3 / 6n)
4074/3125 = (2·3·7·97) / (55) = sum(n4 / 6n)
11334/3125 = (2·3·1889) / (55) = sum(n5 / 6n)
189714/15625 = (2·3·7·4517) / (56) = sum(n6 / 6n)
3706518/78125 = (2·3·181·3413) / (57) = sum(n7 / 6n)
82749954/390625 = (2·3·7·1970237) / (58) = sum(n8 / 6n)
2078250726/1953125 = (2·3·31·1061·10531) / (59) = sum(n9 / 6n)
11598884682/1953125 = (2·3·7·11·232·47459) / (59) = sum(n10 / 6n)


sum(np / 7n)

7/36 = prime / (22·32) = sum(n / 7n)
7/27 = prime / (33) = sum(n2 / 7n)
91/216 = (7·13) / (23·33) = sum(n3 / 7n)
70/81 = (2·5·7) / (34) = sum(n4 / 7n)
2149/972 = (7·307) / (22·35) = sum(n5 / 7n)
3311/486 = (7·11·43) / (2·35) = sum(n6 / 7n)
285929/11664 = (7·40847) / (24·36) = sum(n7 / 7n)
220430/2187 = (2·5·7·47·67) / (37) = sum(n8 / 7n)
1359337/2916 = (7·17·11423) / (22·36) = sum(n9 / 7n)
5239157/2187 = (7·11·68041) / (37) = sum(n10 / 7n)


sum(np / 8n)

8/49 = (23) / (72) = sum(n / 8n)
72/343 = (23·32) / (73) = sum(n2 / 8n)
776/2401 = (23·97) / (74) = sum(n3 / 8n)
10440/16807 = (23·32·5·29) / (75) = sum(n4 / 8n)
174728/117649 = (23·21841) / (76) = sum(n5 / 8n)
3525192/823543 = (23·32·11·4451) / (77) = sum(n6 / 8n)
11870648/823543 = (23·41·36191) / (77) = sum(n7 / 8n)
319735800/5764801 = (23·32·52·19·9349) / (78) = sum(n8 / 8n)
9686934584/40353607 = (23·1210866823) / (79) = sum(n9 / 8n)
326084753016/282475249 = (23·32·11·16273·25301) / (710) = sum(n10 / 8n)


sum(np / 9n)

9/64 = (32) / (26) = sum(n / 9n)
45/256 = (32·5) / (28) = sum(n2 / 9n)
531/2048 = (32·59) / (211) = sum(n3 / 9n)
1935/4096 = (32·5·43) / (212) = sum(n4 / 9n)
34983/32768 = (32·132·23) / (215) = sum(n5 / 9n)
381465/131072 = (32·5·72·173) / (217) = sum(n6 / 9n)
9725787/1048576 = (32·67·1272) / (220) = sum(n7 / 9n)
35420535/1048576 = (32·5·787123) / (220) = sum(n8 / 9n)
1160703963/8388608 = (32·47·409·6709) / (223) = sum(n9 / 9n)
21129845715/33554432 = (32·5·11·2213·19289) / (225) = sum(n10 / 9n)


sum(np / 10n)

10/81 = (2·5) / (34) = sum(n / 10n)
110/729 = (2·5·11) / (36) = sum(n2 / 10n)
470/2187 = (2·5·47) / (37) = sum(n3 / 10n)
7370/19683 = (2·5·11·67) / (39) = sum(n4 / 10n)
142870/177147 = (2·5·7·13·157) / (311) = sum(n5 / 10n)
1114190/531441 = (2·5·7·11·1447) / (312) = sum(n6 / 10n)
30495890/4782969 = (2·5·3049589) / (314) = sum(n7 / 10n)
953934190/43046721 = (2·5·11·569·15241) / (316) = sum(n8 / 10n)
3728765410/43046721 = (2·5·372876541) / (316) = sum(n9 / 10n)
145739620510/387420489 = (2·5·11·1324905641) / (318) = sum(n10 / 10n)

Power Flip

12 is an interesting number in a lot of ways. Here’s one way I haven’t seen mentioned before:

12 = 3^1 * 2^2


The digits of 12 represent the powers of the primes in its factorization, if primes are represented from right-to-left, like this: …7, 5, 3, 2. But I couldn’t find any more numbers like that in base 10, so I tried a power flip, from right-left to left-right. If the digits from left-to-right represent the primes in the order 2, 3, 5, 7…, then this number is has prime-power digits too:

81312000 = 2^8 * 3^1 * 5^3 * 7^1 * 11^2 * 13^0 * 17^0 * 19^0


Or, more simply, given that n^0 = 1:

81312000 = 2^8 * 3^1 * 5^3 * 7^1 * 11^2


I haven’t found any more left-to-right prime-power digital numbers in base 10, but there are more in other bases. Base 5 yields at least three (I’ve ignored numbers with just two digits in a particular base):

110 in b2 = 2^1 * 3^1 (n=6)
130 in b6 = 2^1 * 3^3 (n=54)
1010 in b2 = 2^1 * 3^0 * 5^1 (n=10)
101 in b3 = 2^1 * 3^0 * 5^1 (n=10)
202 in b7 = 2^2 * 3^0 * 5^2 (n=100)
3020 in b4 = 2^3 * 3^0 * 5^2 (n=200)
330 in b8 = 2^3 * 3^3 (n=216)
13310 in b14 = 2^1 * 3^3 * 5^3 * 7^1 (n=47250)
3032000 in b5 = 2^3 * 3^0 * 5^3 * 7^2 (n=49000)
21302000 in b5 = 2^2 * 3^1 * 5^3 * 7^0 * 11^2 (n=181500)
7810000 in b9 = 2^7 * 3^8 * 5^1 (n=4199040)
81312000 in b10 = 2^8 * 3^1 * 5^3 * 7^1 * 11^2


Post-Performative Post-Scriptum

When I searched for 81312000 at the Online Encyclopedia of Integer Sequences, I discovered that these are Meertens numbers, defined at A246532 as the “base n Godel encoding of x [namely,] 2^d(1) * 3^d(2) * … * prime(k)^d(k), where d(1)d(2)…d(k) is the base n representation of x.”

Grow Fourth

Write the integers in groups of one, two, three, four… numbers like this:

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, 37,38,39,40,41,42,43,44,45, 46,47,48,49,50,51,52,53,54,55, 56,57,58,59,60,61,62,63,64,65,66


Now delete every second group:

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, 37,38,39,40,41,42,43,44,45, 46,47,48,49,50,51,52,53,54,55, 56,57,58,59,60,61,62,63,64,65,66…

↓↓↓

1, 4,5,6, 11,12,13,14,15, 22,23,24,25,26,27,28, 37,38,39,40,41,42,43,44,45, 56,57,58,59,60,61,62,63,64,65,66…


The sum of the first n remaining groups equals n^4:

1 = 1 = 1^4

1 + 4+5+6 = 16 = 2^4

1 + 4+5+6 + 11+12+13+14+15 = 81 = 3^4

1 + 4+5+6 + 11+12+13+14+15 + 22+23+24+25+26+27+28 = 256 = 4^4

1 + 4+5+6 + 11+12+13+14+15 + 22+23+24+25+26+27+28 + 37+38+39+40+41+42+43+44+45 = 625 = 5^4

1 + 4+5+6 + 11+12+13+14+15 + 22+23+24+25+26+27+28 + 37+38+39+40+41+42+43+44+45 + 56+57+58+59+60+61+62+63+64+65+66 = 1296 = 6^4

1 + 4+5+6 + 11+12+13+14+15 + 22+23+24+25+26+27+28 + 37+38+39+40+41+42+43+44+45 + 56+57+58+59+60+61+62+63+64+65+66 + 79+80+81+82+83+84+85+86+87+88+89+90+91 = 2401 = 7^4

1 + 4+5+6 + 11+12+13+14+15 + 22+23+24+25+26+27+28 + 37+38+39+40+41+42+43+44+45 + 56+57+58+59+60+61+62+63+64+65+66 + 79+80+81+82+83+84+85+86+87+88+89+90+91 + 106+107+108+109+110+111+112+113+114+115+116+117+118+119+120 = 4096 = 8^4

1 + 4+5+6 + 11+12+13+14+15 + 22+23+24+25+26+27+28 + 37+38+39+40+41+42+43+44+45 + 56+57+58+59+60+61+62+63+64+65+66 + 79+80+81+82+83+84+85+86+87+88+89+90+91 + 106+107+108+109+110+111+112+113+114+115+116+117+118+119+120 + 137+138+139+140+141+142+143+144+145+146+147+148+149+150+151+152+153 = 6561 = 9^4


From David Wells’ Penguin Dictionary of Curious and Interesting Numbers (1986), entry for “81”

Pyramidic Palindromes

As I’ve said before on Overlord of the Über-Feral: squares are boring. As I’ve shown before on Overlord of the Über-Feral: squares are not so boring after all.

Take A000330 at the Online Encyclopedia of Integer Sequences:

1, 5, 14, 30, 55, 91, 140, 204, 285, 385, 506, 650, 819, 1015, 1240, 1496, 1785, 2109, 2470, 2870, 3311, 3795, 4324, 4900, 5525, 6201, 6930, 7714, 8555, 9455, 10416, 11440, 12529, 13685, 14910, 16206, 17575, 19019, 20540, 22140, 23821, 25585, 27434, 29370… — A000330 at OEIS


The sequence shows the square pyramidal numbers, formed by summing the squares of integers:

• 1 = 1^2
• 5 = 1^2 + 2^2 = 1 + 4
• 14 = 1^2 + 2^2 + 3^2 = 1 + 4 + 9
• 30 = 1^2 + 2^2 + 3^2 + 4^2 = 1 + 4 + 9 + 16

[…]


You can see the pyramidality of the square pyramidals when you pile up oranges or cannonballs:

Square pyramid of 91 cannonballs at Rye Castle, East Sussex (Wikipedia)


I looked for palindromes in the square pyramidals. These are the only ones I could find:

1 (k=1)
5 (k=2)
55 (k=5)
1992991 (k=181)


The only ones in base 10, that is. When I looked in base 9 = 3^2, I got a burst of pyramidic palindromes like this:

1 (k=1)
5 (k=2)
33 (k=4) = 30 in base 10 (k=4)
111 (k=6) = 91 in b10 (k=6)
122221 (k=66) = 73810 in b10 (k=60)
123333321 (k=666) = 54406261 in b10 (k=546)
123444444321 (k=6,666) = 39710600020 in b10 (k=4920)
123455555554321 (k=66,666) = 28952950120831 in b10 (k=44286)
123456666666654321 (k=666,666) = 21107018371978630 in b10 (k=398580)
123456777777777654321 (k=6,666,666) = 15387042129569911801 in b10 (k=3587226)
123456788888888887654321 (k=66,666,666) = 11217155797104231969640 in b10 (k=32285040)


The palindromic pattern from 6[…]6 ends with 66,666,666, because 8 is the highest digit in base 9. When you look at the 666,666,666th square pyramidal in base 9, you’ll find it’s not a perfect palindrome:

123456801111111111087654321 (k=666,666,666) = 8177306744945450299267171 in b10 (k=290565366)

But the pattern of pyramidic palindromes is good while it lasts. I can’t find any other base yielding a pattern like that. And base 9 yields another burst of pyramidic palindromes in a related sequence, A000537 at the OEIS:

1, 9, 36, 100, 225, 441, 784, 1296, 2025, 3025, 4356, 6084, 8281, 11025, 14400, 18496, 23409, 29241, 36100, 44100, 53361, 64009, 76176, 90000, 105625, 123201, 142884, 164836, 189225, 216225, 246016, 278784, 314721, 354025, 396900, 443556, 494209, 549081… — A000537 at OEIS


The sequence is what you might call the cubic pyramidal numbers, that is, the sum of the cubes of integers:

• 1 = 1^2
• 9 = 1^2 + 2^3 = 1 + 8
• 36 = 1^3 + 2^3 + 3^3 = 1 + 8 + 27
• 100 = 1^3 + 2^3 + 3^3 + 4^3 = 1 + 8 + 27 + 64

[…]


I looked for palindromes there in base 9:

1 (k=1) = 1 (k=1)
121 (k=4) = 100 in base 10 (k=4)
12321 (k=14) = 8281 (k=13)
1234321 (k=44) = 672400 (k=40)
123454321 (k=144) = 54479161 (k=121)
12345654321 (k=444) = 4412944900 (k=364)
1234567654321 (k=1444) = 357449732641 (k=1093)
123456787654321 (k=4444) = 28953439105600 (k=3280)
102012022050220210201 (k=137227) = 12460125198224404009 (k=84022)


But while palindromes are fun, they’re not usually mathematically significant. However, this result using the square pyramidals is certainly significant:


Previously Pre-Posted…

More posts about how squares aren’t so boring after all:

Curvous Energy
Back to Drac #1
Back to Drac #2
Square’s Flair

Square Pairs

Girard knew and Fermat a few years later proved the beautiful theorem that every prime of the form 4n + 1; that is, the primes 5, 13, 17, 29, 37, 41, 53… is the sum of two squares in exactly one way. Primes of the form 4n + 3, such as 3, 7, 11, 19, 23, 31, 43, 47… are never the sum of two squares. — David Wells, The Penguin Dictionary of Curious and Interesting Numbers (1986), entry for “13”.


Elsewhere other-accessible…

Fermat’s theorem on sums of two squares
Pythagorean primes

Bi-Bell Basics

Here’s what you might call a Sisyphean sequence. It struggles upward, then slips back, over and over again:

1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 1, 2, 2, 3, 2, 3, 3, 4, 2...


The struggle goes on for ever. Every time it reaches a new maximum, it will fall back to 1 at the next step. And in fact 1, 2, 3 and all other integers occur infinitely often in the sequence, because it represents the digit-sums of binary numbers:

1 ← 1
1 = 1+0 ← 10 in binary = 2 in base ten
2 = 1+1 ← 11 = 3
1 = 1+0+0 ← 100 = 4
2 = 1+0+1 ← 101 = 5
2 = 1+1+0 ← 110 = 6
3 = 1+1+1 ← 111 = 7
1 = 1+0+0+0 ← 1000 = 8
2 = 1+0+0+1 ← 1001 = 9
2 = 1+0+1+0 ← 1010 = 10
3 = 1+0+1+1 ← 1011 = 11
2 = 1+1+0+0 ← 1100 = 12
3 = 1+1+0+1 ← 1101 = 13
3 = 1+1+1+0 ← 1110 = 14
4 = 1+1+1+1 ← 1111 = 15
1 = 1+0+0+0+0 ← 10000 = 16
2 = 1+0+0+0+1 ← 10001 = 17
2 = 1+0+0+1+0 ← 10010 = 18
3 = 1+0+0+1+1 ← 10011 = 19
2 = 1+0+1+0+0 ← 10100 = 20


Now here’s a related sequence in which all integers do not occur infinitely often:

1, 2, 3, 3, 4, 5, 6, 4, 5, 6, 7, 7, 8, 9, 10, 5, 6, 7, 8, 8, 9, 10, 11, 9, 10, 11, 12, 12, 13, 14, 15, 6, 7, 8, 9, 9, 10, 11, 12, 10, 11, 12, 13, 13, 14, 15, 16, 11, 12, 13, 14, 14, 15, 16, 17, 15, 16, 17, 18, 18, 19, 20, 21, 7, 8, 9, 10, 10, 11, 12, 13, 11, 12, 13, 14, 14, 15, 16, 17, 12, 13, 14, 15, 15, 16, 17, 18, 16, 17, 18, 19, 19, 20, 21, 22, 13, 14, 15, 16, 16, 17, 18, 19, 17, 18, 19, 20, 20, 21, 22, 23, 18, 19, 20, 21, 21, 22, 23, 24, 22, 23, 24, 25, 25, 26, 27, 28, 8, 9, 10, 11, 11, 12, 13, 14, 12, 13, 14, 15, 15...


The sequence represents the sum of the values of occupied columns in the binary numbers, reading from right to left:

10 in binary = 2 in base ten
21 (column values from right to left)
2*1 + 1*0 = 2


11 = 3
21
2*1 + 1*1 = 3


100 = 4
321 (column values from right to left)
3*1 + 2*0 + 1*0 = 3


101 = 5
321
3*1 + 2*0 + 1*1 = 4


110 = 6
321
3*1 + 2*1 + 1*0 = 5


111 = 7
321
3*1 + 2*1 + 1*1 = 6


1000 = 8
4321
4*1 + 3*0 + 2*0 + 1*0 = 4


1001 = 9
4321
4*1 + 3*0 + 2*0 + 1*1 = 5


1010 = 10
4321
4*1 + 3*0 + 2*1 + 1*0 = 6


1011 = 11
4321
4*1 + 3*0 + 2*1 + 1*1 = 7


1100 = 12
4321
4*1 + 3*1 + 2*0 + 1*0 = 7


1101 = 13
4321
4*1 + 3*1 + 2*0 + 1*1 = 8


1110 = 14
4321
4*1 + 3*1 + 2*1 + 1*0 = 9


1111 = 15
4321
4*1 + 3*1 + 2*1 + 1*1 = 10


10000 = 16
54321
5*1 + 4*0 + 3*0 + 2*0 + 1*0 = 5


In that sequence, although no number occurs infinitely often, some numbers occur more often than others. If you represent the count of sums up to a certain digit-length as a graph, you get a famous shape:

Bell curve formed by the count of column-sums in base 2


Bi-bell curves for 1 to 16 binary digits (animated)


In “Pi in the Bi”, I looked at that way of forming the bell curve and called it the bi-bell curve. Now I want to go further. Suppose that you assign varying values to the columns and try other bases. For example, what happens if you assign the values 2^p + 1 to the columns, reading from right to left, then use base 3 to generate the sums? These are the values of 2^p + 1:

2, 3, 5, 9, 17, 33, 65, 129, 257, 513, 1025...


And here’s an example of how you generate a column-sum in base 3:

2102 in base 3 = 65 in base ten
9532 (column values from right to left)
2*9 + 1*5 + 0*3 + 2*2 = 27


The graphs for these column-sums using base 3 look like this as the digit-length rises. They’re no longer bell-curves (and please note that widths and heights have been normalized so that all graphs fit the same space):

Graph for the count of column-sums in base 3 using 2^p + 1 (digit-length <= 7)

(width and height are normalized)


Graph for base 3 and 2^p + 1 (dl<=8)


Graph for base 3 and 2^p + 1 (dl<=9)


Graph for base 3 and 2^p + 1 (dl<=10)


Graph for base 3 and 2^p + 1 (dl<=11)


Graph for base 3 and 2^p + 1 (dl<=12)


Graph for base 3 and 2^p + 1 (animated)


Now try base 3 and column-values of 2^p + 2 = 3, 4, 6, 10, 18, 34, 66, 130, 258, 514, 1026…

Graph for base 3 and 2^p + 2 (dl<=7)


Graph for base 3 and 2^p + 2 (dl<=8)


Graph for base 3 and 2^p + 2 (dl<=9)


Graph for base 3 and 2^p + 2 (dl<=10)


Graph for base 3 and 2^p + 2 (animated)


Now try base 5 and 2^p + 1 for the columns. The original bell curve has become like a fractal called the blancmange curve:

Graph for base 5 and 2^p + 1 (dl<=7)


Graph for base 5 and 2^p + 1 (dl<=8)


Graph for base 5 and 2^p + 1 (dl<=9)


Graph for base 5 and 2^p + 1 (dl<=10)


Graph for base 5 and 2^p + 1 (animated)


And finally, return to base 2 and try the Fibonacci numbers for the columns:

Graph for base 2 and Fibonacci numbers = 1,1,2,3,5… (dl<=7)


Graph for base 2 and Fibonacci numbers (dl<=9)


Graph for base 2 and Fibonacci numbers (dl<=11)


Graph for base 2 and Fibonacci numbers (dl<=13)


Graph for base 2 and Fibonacci numbers (dl<=15)


Graph for base 2 and Fibonacci numbers (animated)


Previously Pre-Posted…

Pi in the Bi — bell curves generated by binary digits

Root Pursuit

Roots are hard, powers are easy. For example, the square root of 2, or √2, is the mysterious and never-ending number that is equal to 2 when multiplied by itself:

• √2 = 1·414213562373095048801688724209698078569671875376948073...

It’s hard to calculate √2. But the powers of 2, or 2^p, are the straightforward numbers that you get by multiplying 2 repeatedly by itself. It’s easy to calculate 2^p:

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

But there is a way to find √2 by finding 2^p, as I discovered after I asked a simple question about 2^p and 3^p. What are the longest runs of matching digits at the beginning of each power?

131072 = 2^17
129140163 = 3^17
1255420347077336152767157884641... = 2^193
1214512980685298442335534165687... = 3^193
2175541218577478036232553294038... = 2^619
2177993962169082260270654106078... = 3^619
7524389324549354450012295667238... = 2^2016
7524012611682575322123383229826... = 3^2016

There’s no obvious pattern. Then I asked the same question about 2^p and 5^p. And an interesting pattern appeared:

32 = 2^5
3125 = 5^5
316912650057057350374175801344 = 2^98
3155443620884047221646914261131... = 5^98
3162535207926728411757739792483... = 2^1068
3162020133383977882730040274356... = 5^1068
3162266908803418110961625404267... = 2^127185
3162288411569894029343799063611... = 5^127185

The digits 31622 rang a bell. Isn’t that the start of √10? Yes, it is:

• √10 = 3·1622776601683793319988935444327185337195551393252168268575...

I wrote a fast machine-code program to find even longer runs of matching initial digits. Sure enough, the pattern continued:

• 316227... = 2^2728361
• 316227... = 5^2728361
• 3162277... = 2^15917834
• 3162277... = 5^15917834
• 31622776... = 2^73482154
• 31622776... = 5^73482154
• 3162277660... = 2^961700165
• 3162277660... = 5^961700165

But why are powers of 2 and 5 generating the digits of √10? If you’re good at math, that’s a trivial question about a trivial discovery. Here’s the answer: We use base ten and 10 = 2 * 5, 10^2 = 100 = 2^2 * 5^2 = 4 * 25, 10^3 = 1000 = 2^3 * 5^3 = 8 * 125, and so on. When the initial digits of 2^p and 5^p match, those matching digits must come from the digits of √10. Otherwise the product of 2^p * 5^p would be too large or too small. Here are the records for matching initial digits multiplied by themselves:

32 = 2^5
3125 = 5^5
• 3^2 = 9

316912650057057350374175801344 = 2^98
3155443620884047221646914261131... = 5^98
• 31^2 = 961

3162535207926728411757739792483... = 2^1068
3162020133383977882730040274356... = 5^1068
• 3162^2 = 9998244

3162266908803418110961625404267... = 2^127185
3162288411569894029343799063611... = 5^127185
• 31622^2 = 999950884

• 316227... = 2^2728361
• 316227... = 5^2728361
• 316227^2 = 99999515529

• 3162277... = 2^15917834
• 3162277... = 5^15917834
• 3162277^2 = 9999995824729

• 31622776... = 2^73482154
• 31622776... = 5^73482154
• 31622776^2 = 999999961946176

• 3162277660... = 2^961700165
• 3162277660... = 5^961700165
• 3162277660^2 = 9999999998935075600

The square of each matching run falls short of 10^p. And so when the digits of 2^p and 5^p stop matching, one power must fall below √10, as it were, and one must rise above:

3 162266908803418110961625404267... = 2^127185
3·162277660168379331998893544432... = √10
3 162288411569894029343799063611... = 5^127185

In this way, 2^p * 5^p = 10^p. And that’s why matching initial digits of 2^p and 5^p generate the digits of √10. The same thing, mutatis mutandis, happens in base 6 with 2^p and 3^p, because 6 = 2 * 3:

• 2.24103122055214532500432040411... = √6 (in base 6)

24 = 2^4
213 = 3^4
225522024 = 2^34 in base 6 = 2^22 in base 10
22225525003213 = 3^34 (3^22)
2241525132535231233233555114533... = 2^1303 (2^327)
2240133444421105112410441102423... = 3^1303 (3^327)
2241055222343212030022044325420... = 2^153251 (2^15007)
2241003215453455515322105001310... = 3^153251 (3^15007)
2241032233315203525544525150530... = 2^233204 (2^20164)
2241030204225410320250422435321... = 3^233204 (3^20164)
2241031334114245140003252435303... = 2^2110415 (2^102539)
2241031103430053425141014505442... = 3^2110415 (3^102539)

And in base 30, where 30 = 2 * 3 * 5, you can find the digits of √30 in three different ways, because 30 = 2 * 15 = 3 * 10 = 5 * 6:

• 5·E9F2LE6BBPBF0F52B7385PE6E5CLN... = √30 (in base 30)

55AA4 = 2^M in base 30 = 2^22 in base 10
5NO6CQN69C3Q0E1Q7F = F^M = 15^22
5E63NMOAO4JPQD6996F3HPLIMLIRL6F... = 2^K6 (2^606)
5ECQDMIOCIAIR0DGJ4O4H8EN10AQ2GR... = F^K6 (15^606)
5E9DTE7BO41HIQDDO0NB1MFNEE4QJRF... = 2^B14 (2^9934)
5E9G5SL7KBNKFLKSG89J9J9NT17KHHO... = F^B14 (15^9934)
[...]
5R4C9 = 3^E in base 30 = 3^14 in base 10
52CE6A3L3A = A^E = 10^14
5E6SOQE5II5A8IRCH9HFBGO7835KL8A = 3^3N (3^113)
5EC1BLQHNJLTGD00SLBEDQ73AH465E3... = A^3N (10^113)
5E9FI455MQI4KOJM0HSBP3GG6OL9T8P... = 3^EJH (3^13187)
5E9EH8N8D9TR1AH48MT7OR3MHAGFNFQ... = A^EJH (10^13187)
[...]
5OCNCNRAP = 5^I in base 30 = 5^18 in base 10
54NO22GI76 = 6^I (6^18)
5EG4RAMD1IGGHQ8QS2QR0S0EH09DK16... = 5^1M7 (5^1567)
5E2PG4Q2G63DOBIJ54E4O035Q9TEJGH... = 6^1M7 (6^1567)
5E96DB9T6TBIM1FCCK8A8J7IDRCTM71... = 5^F9G (5^13786)
5E9NM222PN9Q9TEFTJ94261NRBB8FCH... = 6^F9G (6^13786)
[...]

So that’s √10, √6 and √30. But I said at the beginning that you can find √2 by finding 2^p. How do you do that? By offsetting the powers, as it were. With 2^p and 5^p, you can find the digits of √10. With 2^(p+1) and 5^p, you can find the digits of √2 and √20, because 2^(p+1) * 5^p = 2 * 2^p * 5^p = 2 * 10^p:

•  √2 = 1·414213562373095048801688724209698078569671875376948073...
• √20 = 4·472135954999579392818347337462552470881236719223051448...

16 = 2^4
125 = 5^3
140737488355328 = 2^47
142108547152020037174224853515625 = 5^46
1413... = 2^243
1414... = 5^242
14141... = 2^6651
14142... = 5^6650
141421... = 2^35389
141420... = 5^35388
4472136... = 2^162574
4472135... = 5^162573
141421359... = 2^3216082
141421352... = 5^3216081
447213595... = 2^172530387
447213595... = 5^172530386
[...]

God Give Me Benf’

In “Wake the Snake”, I looked at the digits of powers of 2 and mentioned a fascinating mathematical phenomenon known as Benford’s law, which governs — in a not-yet-fully-explained way — the leading digits of a wide variety of natural and human statistics, from the lengths of rivers to the votes cast in elections. Benford’s law also governs a lot of mathematical data. It states, for example, that the first digit, d, of a power of 2 in base b (except b = 2, 4, 8, 16…) will occur with the frequency logb(1 + 1/d). In base 10, therefore, Benford’s law states that the digits 1..9 will occur with the following frequencies at the beginning of 2^p:

1: 30.102999%
2: 17.609125%
3: 12.493873%
4: 09.691001%
5: 07.918124%
6: 06.694678%
7: 05.799194%
8: 05.115252%
9: 04.575749%

Here’s a graph of the actual relative frequencies of 1..9 as the leading digit of 2^p (open images in a new window if they appear distorted):


And here’s a graph for the predicted frequencies of 1..9 as the leading digit of 2^p, as calculated by the log(1+1/d) of Benford’s law:


The two graphs agree very well. But Benford’s law applies to more than one leading digit. Here are actual and predicted graphs for the first two leading digits of 2^p, 10..99:



And actual and predicted graphs for the first three leading digits of 2^p, 100..999:



But you can represent the leading digit of 2^p in another way: using an adaptation of the famous Ulam spiral. Suppose powers of 2 are represented as a spiral of squares that begins like this, with 2^0 in the center, 2^1 to the right of center, 2^2 above 2^1, and so on:

←←←⮲
432↑
501↑
6789

If the digits of 2^p start with 1, fill the square in question; if the digits of 2^p don’t start with 1, leave the square empty. When you do this, you get this interesting pattern (the purple square at the very center represents 2^0):

Ulam-like power-spiral for 2^p where 1 is the leading digit


Here’s a higher-resolution power-spiral for 1 as the leading digit:

Power-spiral for 2^p, leading-digit = 1 (higher resolution)


And here, at higher resolution still, are power-spirals for all the possible leading digits of 2^p, 1..9 (some spirals look very similar, so you have to compare those ones carefully):

Power-spiral for 2^p, leading-digit = 1 (very high resolution)


Power-spiral for 2^p, leading-digit = 2


Power-spiral for 2^p, ld = 3


Power-spiral for 2^p, ld = 4


Power-spiral for 2^p, ld = 5


Power-spiral for 2^p, ld = 6


Power-spiral for 2^p, ld = 7


Power-spiral for 2^p, ld = 8


Power-spiral for 2^p, ld = 9


Power-spiral for 2^p, ld = 1..9 (animated)


Now try the power-spiral of 2^p, ld = 1, in some other bases:

Power-spiral for 2^p, leading-digit = 1, base = 9


Power-spiral for 2^p, ld = 1, b = 15


You can also try power-spirals for other n^p. Here’s 3^p:

Power-spiral for 3^p, ld = 1, b = 10


Power-spiral for 3^p, ld = 2, b = 10


Power-spiral for 3^p, ld = 1, b = 4


Power-spiral for 3^p, ld = 1, b = 7


Power-spiral for 3^p, ld = 1, b = 18


Elsewhere Other-Accessible…

Wake the Snake — an earlier look at the digits of 2^p