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

The Hill to Power

89 is special because it’s a prime number, divisible by only itself and 1. It’s also a sum of powers in a special way: 89 = 8^1 + 9^2. In base ten, no other two-digit number is equal to its own ascending power-sum like that. But the same pattern appears in these three-digit numbers, as the powers climb with the digits:

135 = 1^1 + 3^2 + 5^3 = 1 + 9 + 125 = 135
175 = 1^1 + 7^2 + 5^3 = 1 + 49 + 125 = 175
518 = 5^1 + 1^2 + 8^3 = 5 + 1 + 512 = 518
598 = 5^1 + 9^2 + 8^3 = 5 + 81 + 512 = 598

And in these four-digit numbers:

1306 = 1^1 + 3^2 + 0^3 + 6^4 = 1 + 9 + 0 + 1296 = 1306
1676 = 1^1 + 6^2 + 7^3 + 6^4 = 1 + 36 + 343 + 1296 = 1676
2427 = 2^1 + 4^2 + 2^3 + 7^4 = 2 + 16 + 8 + 2401 = 2427

The pattern doesn’t apply to any five-digit number in base-10 and six-digit numbers supply only this near miss:

263248 + 1 = 2^1 + 6^2 + 3^3 + 2^4 + 4^5 + 8^6 = 2 + 36 + 27 + 16 + 1024 + 262144 = 263249

But the pattern re-appears among seven-digit numbers:

2646798 = 2^1 + 6^2 + 4^3 + 6^4 + 7^5 + 9^6 + 8^7 = 2 + 36 + 64 + 1296 + 16807 + 531441 + 2097152 = 2646798

Now try some base behaviour. Some power-sums in base-10 are power-sums in another base:

175 = 1^1 + 7^2 + 5^3 = 1 + 49 + 125 = 175
175 = 6D[b=27] = 6^1 + 13^2 = 6 + 169 = 175

1306 = 1^1 + 3^2 + 0^3 + 6^4 = 1 + 9 + 0 + 1296 = 1306
1306 = A[36][b=127] = 10^1 + 36^2 = 10 + 1296 = 1306

Here is an incomplete list of double-base power-sums:

83 = 1103[b=4] = 1^1 + 1^2 + 0^3 + 3^4 = 1 + 1 + 0 + 81 = 83
83 = 29[b=37] = 2^1 + 9^2 = 2 + 81 = 83

126 = 105[b=11] = 1^1 + 0^2 + 5^3 = 1 + 0 + 125 = 126
126 = 5B[b=23] = 5^1 + 11^2 = 5 + 121 = 126

175 = 1^1 + 7^2 + 5^3 = 1 + 49 + 125 = 175
175 = 6D[b=27] = 6^1 + 13^2 = 6 + 169 = 175

259 = 2014[b=5] = 2^1 + 0^2 + 1^3 + 4^4 = 2 + 0 + 1 + 256 = 259
259 = 3G[b=81] = 3^1 + 16^2 = 3 + 256 = 259

266 = 176[b=13] = 1^1 + 7^2 + 6^3 = 1 + 49 + 216 = 266
266 = AG[b=25] = 10^1 + 16^2 = 10 + 256 = 266

578 = 288[b=15] = 2^1 + 8^2 + 8^3 = 2 + 64 + 512 = 578
578 = 2[24][b=277] = 2^1 + 24^2 = 2 + 576 = 578

580 = 488[b=11] = 4^1 + 8^2 + 8^3 = 4 + 64 + 512 = 580
580 = 4[24][b=139] = 4^1 + 24^2 = 4 + 576 = 580

731 = 209[b=19] = 2^1 + 0^2 + 9^3 = 2 + 0 + 729 = 731
731 = 2[27][b=352] = 2^1 + 27^2 = 2 + 729 = 731

735 = 609[b=11] = 6^1 + 0^2 + 9^3 = 6 + 0 + 729 = 735
735 = 6[27][b=118] = 6^1 + 27^2 = 6 + 729 = 735

1306 = 1^1 + 3^2 + 0^3 + 6^4 = 1 + 9 + 0 + 1296 = 1306
1306 = A[36][b=127] = 10^1 + 36^2 = 10 + 1296 = 1306

1852 = 3BC[b=23] = 3^1 + 11^2 + 12^3 = 3 + 121 + 1728 = 1852
1852 = 3[43][b=603] = 3^1 + 43^2 = 3 + 1849 = 1852

2943 = 3EE[b=29] = 3^1 + 14^2 + 14^3 = 3 + 196 + 2744 = 2943
2943 = [27][54][b=107] = 27^1 + 54^2 = 27 + 2916 = 2943


Previously pre-posted (please peruse):

Narcissarithmetic #1
Narcissarithmetic #2

Narcissarithmetic #2

It’s easy to find patterns like these in base ten:

81 = (8 + 1)^2 = 9^2 = 81

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

2401 = (2 + 4 + 0 + 1)^4 = 7^4 = 2401
234256 = (2 + 3 + 4 + 2 + 5 + 6)^4 = 22^4 = 234256
390625 = (3 + 9 + 0 + 6 + 2 + 5)^4 = 25^4 = 390625
614656 = (6 + 1 + 4 + 6 + 5 + 6)^4 = 28^4 = 614656
1679616 = (1 + 6 + 7 + 9 + 6 + 1 + 6)^4 = 36^4 = 1679616

17210368 = (1 + 7 + 2 + 1 + 0 + 3 + 6 + 8)^5 = 28^5 = 17210368
52521875 = (5 + 2 + 5 + 2 + 1 + 8 + 7 + 5)^5 = 35^5 = 52521875
60466176 = (6 + 0 + 4 + 6 + 6 + 1 + 7 + 6)^5 = 36^5 = 60466176
205962976 = (2 + 0 + 5 + 9 + 6 + 2 + 9 + 7 + 6)^5 = 46^5 = 205962976

1215766545905692880100000000000000000000 = (1 + 2 + 1 + 5 + 7 + 6 + 6 + 5 + 4 + 5 + 9 + 0 + 5 + 6 + 9 + 2 + 8 + 8 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0)^20 = 90^20 = 1215766545905692880100000000000000000000

Patterns like this are much rarer:

914457600 = (9 x 1 x 4 x 4 x 5 x 7 x 6)^2 = 30240^2 = 914457600

3657830400 = (3 x 6 x 5 x 7 x 8 x 3 x 4)^2 = 60480^2 = 3657830400

I haven’t found a cube like that in base ten, but base six supplies them:

2212 = (2 x 2 x 1 x 2)^3 = 12^3 = 2212 (b=6) = 8^3 = 512 (b=10)
325000 = (3 x 2 x 5)^3 = 50^3 = 325000 (b=6) = 30^3 = 27000 (b=10)
411412 = (4 x 1 x 1 x 4 x 1 x 2)^3 = 52^3 = 411412 (b=6) = 32^3 = 32768 (b=10)

And base nine supplies a fourth and fifth power:

31400 = (3 x 1 x 4)^4 = 13^4 = 31400 (b=9) = 12^4 = 20736 (b=10)
11600 = (1 x 1 x 6)^5 = 6^5 = 11600 (b=9) = 6^5 = 7776 (b=10)

Then base ten is rich in patterns like these:

81 = (8^1 + 1^1) x (8 + 1) = 9 x 9 = 81

133 = (1^2 + 3^2 + 3^2) x (1 + 3 + 3) = 19 x 7 = 133
315 = (3^2 + 1^2 + 5^2) x (3 + 1 + 5) = 35 x 9 = 315
803 = (8^2 + 0^2 + 3^2) x (8 + 0 + 3) = 73 x 11 = 803
1148 = (1^2 + 1^2 + 4^2 + 8^2) x (1 + 1 + 4 + 8) = 82 x 14 = 1148
1547 = (1^2 + 5^2 + 4^2 + 7^2) x (1 + 5 + 4 + 7) = 91 x 17 = 1547
2196 = (2^2 + 1^2 + 9^2 + 6^2) x (2 + 1 + 9 + 6) = 122 x 18 = 2196

1215 = (1^3 + 2^3 + 1^3 + 5^3) x (1 + 2 + 1 + 5) = 135 x 9 = 1215
3700 = (3^3 + 7^3 + 0^3 + 0^3) x (3 + 7 + 0 + 0) = 370 x 10 = 3700
11680 = (1^3 + 1^3 + 6^3 + 8^3 + 0^3) x (1 + 1 + 6 + 8 + 0) = 730 x 16 = 11680
13608 = (1^3 + 3^3 + 6^3 + 0^3 + 8^3) x (1 + 3 + 6 + 0 + 8) = 756 x 18 = 13608
87949 = (8^3 + 7^3 + 9^3 + 4^3 + 9^3) x (8 + 7 + 9 + 4 + 9) = 2377 x 37 = 87949

182380 = (1^4 + 8^4 + 2^4 + 3^4 + 8^4 + 0^4) x (1 + 8 + 2 + 3 + 8 + 0) = 8290 x 22 = 182380
444992 = (4^4 + 4^4 + 4^4 + 9^4 + 9^4 + 2^4) x (4 + 4 + 4 + 9 + 9 + 2) = 13906 x 32 = 444992

41500 = (4^5 + 1^5 + 5^5 + 0^5 + 0^5) x (4 + 1 + 5 + 0 + 0) = 4150 x 10 = 41500
3508936 = (3^5 + 5^5 + 0^5 + 8^5 + 9^5 + 3^5 + 6^5) x (3 + 5 + 0 + 8 + 9 + 3 + 6) = 103204 x 34 = 3508936
3828816 = (3^5 + 8^5 + 2^5 + 8^5 + 8^5 + 1^5 + 6^5) x (3 + 8 + 2 + 8 + 8 + 1 + 6) = 106356 x 36 = 3828816
4801896 = (4^5 + 8^5 + 0^5 + 1^5 + 8^5 + 9^5 + 6^5) x (4 + 8 + 0 + 1 + 8 + 9 + 6) = 133386 x 36 = 4801896
5659875 = (5^5 + 6^5 + 5^5 + 9^5 + 8^5 + 7^5 + 5^5) x (5 + 6 + 5 + 9 + 8 + 7 + 5) = 125775 x 45 = 5659875


Previously pre-posted (please peruse):

Narcissarithmetic

Narcissarithmetic

Why is 438,579,088 a beautiful number? Simple: it may seem entirely arbitrary, but it’s actually self-empowered:

438,579,088 = 4^4 + 3^3 + 8^8 + 5^5 + 7^7 + 9^9 + 0^0 + 8^8 + 8^8 = 256 + 27 + 16777216 + 3125 + 823543 + 387420489 + 0 + 16777216 + 16777216 (usually 0^0 = 1, but the rule is slightly varied here)

438,579,088 is so beautiful, in fact, that it’s in love with itself as a narcissistic number, or number that can be generated by manipulation of its own digits. 89 = 8^1 + 9^2 = 8 + 81 and 135 = 1^1 + 3^2 + 5^3 = 1 + 9 + 125 are different kinds of narcissistic number. 3435 is self-empowered again:

3435 = 3^3 + 4^4 + 3^3 + 5^5 = 27 + 256 + 27 + 3125

But that’s your lot: there are no more numbers in base-10 that are equal to the sum of their self-empowered digits (apart from the trivial 0 and 1). To prove this, start by considering that there is a limit to the size of a self-empowered number. 9^9 is 387,420,489, which is nine digits long. The function autopower(999,999,999) = 387,420,489 x 9 = 3,486,784,401, which is ten digits long. But autopower(999,999,999,999) = 387,420,489 x 12 = 4,649,045,868, also ten digits long.

The Metamorphosis of Narcissus by Salvador Dalí

Salvador Dalí, La Metamorfosis de Narciso (1937)

So you don’t need to check numbers above a certain size. There still seem a lot of numbers to check: 438,579,088 is a long way above 3435. However, the search is easy to shorten if you consider that checking 3-3-4-5 is equivalent to checking 3-4-3-5, just as checking 034,578,889 is equivalent to checking 438,579,088. If you self-empower a number and the result has the same digits as the original number, you’ve found what you’re looking for. The order of digits in the original number doesn’t matter, because the result has automatically sorted them for you. The function autopower(3345) produces 3435, therefore 3435 must be self-empowered.

So the rule is simple: Check only the numbers in which any digit is greater than or equal to all digits to its left. In other words, you check 12 and skip 21, check 34 and skip 43, check 567 and skip 576, 657, 675, 756 and 765. That reduces the search-time considerably: discarding numbers is computationally simpler than self-empowering them. It’s also computationally simple to vary the base in which you’re searching. Base-10 produces only two self-empowered numbers, but its neighbours base-9 and base-11 are much more fertile:

30 = 3^3 + 0^0 = 30 + 0 (b=9)
27 = 27 + 0 (b=10)

31 = 3^3 + 1^1 = 30 + 1 (b=9)
28 = 27 + 1 (b=10)

156262 = 1^1 + 5^5 + 6^6 + 2^2 + 6^6 + 2^2 = 1 + 4252 + 71000 + 4 + 71000 + 4 (b=9)
96446 = 1 + 3125 + 46656 + 4 + 46656 + 4 (b=10)

1647063 = 1^1 + 6^6 + 4^4 + 7^7 + 0^0 + 6^6 + 3^3 = 1 + 71000 + 314 + 1484617 + 0 + 71000 + 30 (b=9)
917139 = 1 + 46656 + 256 + 823543 + 0 + 46656 + 27 (b=10)

1656547 = 1^1 + 6^6 + 5^5 + 6^6 + 5^5 + 4^4 + 7^7 = 1 + 71000 + 4252 + 71000 + 4252 + 314 + 1484617 (b=9)
923362 = 1 + 46656 + 3125 + 46656 + 3125 + 256 + 823543 (b=10)

34664084 = 3^3 + 4^4 + 6^6 + 6^6 + 4^4 + 0^0 + 8^8 + 4^4 = 30 + 314 + 71000 + 71000 + 314 + 0 + 34511011 + 314 (b=9)
16871323 = 27 + 256 + 46656 + 46656 + 256 + 0 + 16777216 + 256 (b=10)

66500 = 6^6 + 6^6 + 5^5 + 0^0 + 0^0 = 32065 + 32065 + 2391 + 0 + 0 (b=11)
96437 = 46656 + 46656 + 3125 + 0 + 0 (b=10)

66501 = 6^6 + 6^6 + 5^5 + 0^0 + 1^1 = 32065 + 32065 + 2391 + 0 + 1 (b=11)
96438 = 46656 + 46656 + 3125 + 0 + 1 (b=10)

517503 = 5^5 + 1^1 + 7^7 + 5^5 + 0^0 + 3^3 = 2391 + 1 + 512816 + 2391 + 0 + 25 (b=11)
829821 = 3125 + 1 + 823543 + 3125 + 0 + 27 (b=10)

18453278 = 1^1 + 8^8 + 4^4 + 5^5 + 3^3 + 2^2 + 7^7 + 8^8 = 1 + 9519A75 + 213 + 2391 + 25 + 4 + 512816 + 9519A75 (b=11)
34381388 = 1 + 16777216 + 256 + 3125 + 27 + 4 + 823543 + 16777216 (b=10)

18453487 = 1^1 + 8^8 + 4^4 + 5^5 + 3^3 + 4^4 + 8^8 + 7^7 = 1 + 9519A75 + 213 + 2391 + 25 + 213 + 9519A75 + 512816 (b=11)
34381640 = 1 + 16777216 + 256 + 3125 + 27 + 256 + 16777216 + 823543 (b=10)

It’s easy to extend the concept of self-empowered narcisso-numbers. The prime 71 = 131 in base-7 and the prime 83 = 146 in base-7. If 131[b=7] is empowered to the digits of 146[b=7], you get 146[b=7]; and if 146[b=7] is empowered to the digits of 131[b=7], you get 131[b=7], like this:

71 = 131[b=7] → 1^1 + 3^4 + 1^6 = 1 + 81 + 1 = 83 = 146[b=7]

83 = 146[b=7] → 1^1 + 4^3 + 6^1 = 1 + 64 + 6 = 71 = 131[b=7]

But it’s not easy to find more examples. Are there other-empowering pairs like that in base-10? I don’t know.

More Multi-Magic

The answer, I’m glad to say, is yes. The question is: Can a prime magic-square nest inside a second prime magic-square that nests inside a third prime magic-square? I asked this in Multi-Magic, where I described how a magic square is a square of numbers where all rows, all columns and both diagonals add to the same number, or magic total. This magic square consists entirely of prime numbers, or numbers divisible only by themselves and 1:

43 | 01 | 67
61 | 37 | 13
07 | 73 | 31

Base = 10, magic total = 111

It nests inside this prime magic-square, whose digit-sums in base-97 re-create it:

0619  =  [06][37] | 0097  =  [01][00] | 1123  =  [11][56]
1117  =  [11][50] | 0613  =  [06][31] | 0109  =  [01][12]
0103  =  [01][06] | 1129  =  [11][62] | 0607  =  [06][25]

Base = 97, magic total = 1839

And that prime magic-square nests inside this one:

2803  =  [1][0618] | 2281  =  [1][0096] | 3307  =  [1][1122]
3301  =  [1][1116] | 2797  =  [1][0612] | 2293  =  [1][0108]
2287  =  [1][0102] | 3313  =  [1][1128] | 2791  =  [1][0606]

Base = 2185, magic total = 8391

I don’t know whether that prime magic-square nests inside a fourth square, but a 3-nest is good for 3×3 magic squares. On the other hand, this famous 3×3 magic square is easy to nest inside an infinite series of other magic squares:

6 | 1 | 8
7 | 5 | 3
2 | 9 | 4

Base = 10, magic total = 15

It’s created by the digit-sums of this square in base-9 (“14 = 15” means that the number 14 is represented as “15” in base-9):

14 = 15 → 6 | 09 = 10 → 1 | 16 = 17 → 8
15 = 16 → 7 | 13 = 14 → 5 | 11 = 12 → 3
10 = 11 → 2 | 17 = 18 → 9 | 12 = 13 → 4

Base = 9, magic total = 39


And that square in base-9 is created by the digit-sums of this square in base-17:

30 = 1[13] → 14 | 25 = 00018 → 09 | 32 = 1[15] → 16
31 = 1[14] → 15 | 29 = 1[12] → 13 | 27 = 1[10] → 11
26 = 00019 → 10 | 33 = 1[16] → 17 | 28 = 1[11] → 12

Base = 17, magic total = 87

And so on:

62 = 1[29] → 30 | 57 = 1[24] → 25 | 64 = 1[31] → 32
63 = 1[30] → 31 | 61 = 1[28] → 29 | 59 = 1[26] → 27
58 = 1[25] → 26 | 65 = 1[32] → 33 | 60 = 1[27] → 28

Base = 33, magic total = 183

126 = 1[61] → 62 | 121 = 1[56] → 57 | 128 = 1[63] → 64
127 = 1[62] → 63 | 125 = 1[60] → 61 | 123 = 1[58] → 59
122 = 1[57] → 58 | 129 = 1[64] → 65 | 124 = 1[59] → 60

Base = 65, magic total = 375

Previously Pre-Posted (please peruse):

Multi-Magic

Multi-Magic

A magic square is a square of numbers in which all rows, all columns and both diagonals add to the same number, or magic total. The simplest magic square using distinct numbers is this:

6 1 8
7 5 3
2 9 4

It’s easy to prove that the magic total of a 3×3 magic square must be three times the central number. Accordingly, if the central number is 37, the magic total must be 111. There are lots of ways to create a magic square with 37 at its heart, but this is my favourite:

43 | 01 | 67
61 | 37 | 13
07 | 73 | 31

The square is special because all the numbers are prime, or divisible by only themselves and 1 (though 1 itself is not usually defined as prime in modern mathematics). I like the 37-square even more now that I’ve discovered it can be found inside another all-prime magic square:

0619 = 0006[37] | 0097 = 00000010 | 1123 = [11][56]
1117 = [11][50] | 0613 = 0006[31] | 0109 = 0001[12]
0103 = 00000016 | 1129 = [11][62] | 0607 = 0006[25]

Magic total = 1839

The square is shown in both base-10 and base-97. If the digit-sums of the base-97 square are calculated, this is the result (e.g., the digit-sum of 6[37][b=97] = 6 + 37 = 43):

43 | 01 | 67
61 | 37 | 13
07 | 73 | 31

This makes me wonder whether the 613-square might nest in another all-prime square, and so on, perhaps ad infinitum [Update: yes, the 613-square is a nestling]. There are certainly many nested all-prime squares. Here is square-631 in base-187:

661 = 003[100] | 379 = 00000025 | 853 = 004[105]
823 = 004[075] | 631 = 003[070] | 439 = 002[065]
409 = 002[035] | 883 = 004[135] | 601 = 003[040]

Magic total = 1893

Digit-sums:

103 | 007 | 109
079 | 073 | 067
037 | 139 | 043

Magic total = 219

There are also all-prime magic squares that have two kinds of nestlings inside them: digit-sum magic squares and digit-product magic squares. The digit-product of a number is calculated by multiplying its digits (except 0): digit-product(37) = 3 x 7 = 21, digit-product(103) = 1 x 3 = 3, and so on. In base-331, this all-prime magic square yields both a digit-sum square and a digit-product square:

503 = 1[172] | 359 = 1[028] | 521 = 1[190]
479 = 1[148] | 461 = 1[130] | 443 = 1[112]
401 = 1[070] | 563 = 1[232] | 419 = 1[088]

Magic total = 1383

Digit-sums:

173 | 029 | 191
149 | 131 | 113
071 | 233 | 089

Magic total = 393

Digit-products:

172 | 028 | 190
148 | 130 | 112
070 | 232 | 088

Magic total = 390

Here are two more twin-bearing all-prime magic squares:

Square-719 in base-451:

761 = 1[310] | 557 = 1[106] | 839 = 1[388]
797 = 1[346] | 719 = 1[268] | 641 = 1[190]
599 = 1[148] | 881 = 1[430] | 677 = 1[226]

Magic total = 2157

Digit-sums:

311 | 107 | 389
347 | 269 | 191
149 | 431 | 227

Magic total = 807

Digit-products:

310 | 106 | 388
346 | 268 | 190
148 | 430 | 226

Magic total = 804

Square-853 in base-344:

883 = 2[195] | 709 = 2[021] | 967 = 2[279]
937 = 2[249] | 853 = 2[165] | 769 = 2[081]
739 = 2[051] | 997 = 2[309] | 823 = 2[135]

Magic total = 2559

Digit-sums:

197 | 023 | 281
251 | 167 | 083
053 | 311 | 137

Magic total = 501

Digit-products:

390 | 042 | 558
498 | 330 | 162
102 | 618 | 270

Magic total = 990

Proviously Post-Posted (please peruse):

More Multi-Magic

Roo’s Who

11 is a prime number, divisible by only itself and 1. If you add its digits, 1 + 1, you get 2. 11 + 2 = 13, another prime number. And 13 + (1 + 3) = 17, a third prime number. And there it ends, because 17 + (1 + 7) = 25 = 5 x 5. I call (11, 13, 17) kangaroo primes, because one jumps to another. In base 10, the record for numbers below 1,000,000 is this:

6 primes: 516493 + 28 = 516521 + 20 = 516541 + 22 = 516563 + 26 = 516589 + 34 = 516623.

In base 16, the record is this:

8 primes: 97397 = 17,C75[b=16] + 32 = 97429 = 17,C95[b=16] + 34 = 97463 = 17,CB7[b=16] + 38 = 97501 = 17,CDD[b=16] + 46 = 97547 = 17,D0B[b=16] + 32 = 97579 = 17,D2B[b=16] + 34 = 97613 = 17,D4D[b=16] + 38 = 97651 = 17,D73[b=16].

Another kind of kangaroo prime is found not by adding the sum of digits, but by adding their product, i.e., the result of multiplying the digits (except 0). 23 + (2 x 3) = 29. 29 + (2 x 9) = 47. But 47 + (4 x 7) = 75 = 3 x 5 x 5. So (23, 29, 47) are kangaroo primes too. In base 10, the record for numbers below 1,000,000 is this:

9 primes: 524219 + 720 = 524939 + 9720 = 534659 + 16200 = 550859 + 9000 = 559859 + 81000 = 640859 + 8640 = 649499 + 69984 = 719483 + 6048 = 725531.

But what about subtraction? For a reason I don’t understand, subtracting the digit-sum doesn’t seem to create any kangaroo-primes in base 10. But 11 in base 8 is 13 = 1 x 8^1 + 3 x 8^0 and 13[b=8] – (1 + 3) = 7. In base 2, this sequence appears:

1619 = 11,001,010,011[b=2] – 6 = 1613 = 11,001,001,101[b=2] – 6 = 1607 = 11,001,000,111[b=2] – 6 = 1601 = 11,001,000,001[b=2] – 4 = 1597.

However, subtracting the digit-product creates kangaroo-primes in base 10. For example, 23 – (2 x 3) = 17. The record below 1,000,000 is this (when 0 is found in the digits of a number, it is not included in the multiplication):

7 primes: 64037 – 504 = 63533 – 810 = 62723 – 504 = 62219 – 216 = 62003 – 36 = 61967 – 2268 = 59699.

Base 2 also provides examples of addition/subtraction pairs of kangaroo-primes, like this:

3 = 11[b=2] + 2 = 5 = 101[b=2] | 5 = 101[b=2] – 2 = 3

277 = 100,010,101[b=2] + 4 = 281 = 100,011,001[b=2] | 281 – 4 = 277

311 = 100,110,111[b=2] + 6 = 317 = 100,111,101[b=2] | 317 – 6 = 311

In base 10, addition/subtraction pairs are created by the digit-product, like this:

239 + 54 = 293 | 293 – 54 = 239
563 + 90 = 653 | 653 – 90 = 563
613 + 18 = 631 | 631 – 18 = 613
2791 + 126 = 2917 | 2917 – 126 = 2791
3259 + 270 = 3529 | 3529 – 270 = 3259
5233 + 90 = 5323 | 5323 – 90 = 5233
5297 + 630 = 5927 | 5927 – 630 = 5297
6113 + 18 = 6131 | 6131 – 18 = 6113
10613 + 18 = 10631 | 10631 – 18 = 10613
12791 + 126 = 12917 | 12917 – 126 = 12791

You could call these boxing primes, like boxing kangaroos. The two primes in the pair usually have the same digits in different arrangements, but there are also pairs like these:

24527 + 560 = 25087 | 25087 – 560 = 24527
25183 + 240 = 25423 | 25423 – 240 = 25183
50849 + 1440 = 52289 | 52289 – 1440 = 50849

Summer-Climb Views

Simple things can sometimes baffle advanced minds. If you take a number, reverse its digits, add the result to the original number, then repeat all that, will you eventually get a palindrome? (I.e., a number, like 343 or 27172, that reads the same in both directions.) Many numbers do seem to produce palindromes sooner or later. Here are 195 and 197:

195 + 591 = 786 + 687 = 1473 + 3741 = 5214 + 4125 = 9339 (4 steps)

197 + 791 = 988 + 889 = 1877 + 7781 = 9658 + 8569 = 18227 + 72281 = 90508 + 80509 = 171017 + 710171 = 881188 (7 steps)

But what about 196? Well, it starts like this:

196 + 691 = 887 + 788 = 1675 + 5761 = 7436 + 6347 = 13783 + 38731 = 52514 + 41525 = 94039 + 93049 = 187088 + 880781 = 1067869 + 9687601 = 10755470 + 7455701 = 18211171 + 17111281 = 35322452 + 25422353 = 60744805 + 50844706 = 111589511 + 115985111 = 227574622 + 226475722 = 454050344 + 443050454 = 897100798 + 897001798 = 1794102596 + 6952014971 = 8746117567 + 7657116478 = 16403234045 + 54043230461 = 70446464506 + 60546464407 = 130992928913 + 319829299031 = 450822227944 + 449722228054 = 900544455998…

And so far, after literally years of computing by mathematicians, it hasn’t produced a palindrome. It seems very unlikely it ever will, but no-one can prove this and say that 196 is, in base 10, a Lychrel number, or a number that never produces a palindrome. In other words, a simple thing has baffled advanced minds.

I don’t know whether it can baffle advanced minds, but here’s another simple mathematical technique: sum all the digits of a number, then add the result to the original number and repeat. How long before a palindrome appears in this case? Sum it and see:

10 + 1 = 11

12 + 3 = 15 + 6 = 21 + 3 = 24 + 6 = 30 + 3 = 33 (5 steps)

13 + 4 = 17 + 8 = 25 + 7 = 32 + 5 = 37 + 10 = 47 + 11 = 58 + 13 = 71 + 8 = 79 + 16 = 95 + 14 = 109 + 10 = 119 + 11 = 130 + 4 = 134 + 8 = 142 + 7 = 149 + 14 = 163 + 10 = 173 + 11 = 184 + 13 = 197 + 17 = 214 + 7 = 221 + 5 = 226 + 10 = 236 + 11 = 247 + 13 = 260 + 8 = 268 + 16 = 284 + 14 = 298 + 19 = 317 + 11 = 328 + 13 = 341 + 8 = 349 + 16 = 365 + 14 = 379 + 19 = 398 + 20 = 418 + 13 = 431 + 8 = 439 + 16 = 455 + 14 = 469 + 19 = 488 + 20 = 508 + 13 = 521 + 8 = 529 + 16 = 545 (45 steps)

14 + 5 = 19 + 10 = 29 + 11 = 40 + 4 = 44 (4 steps)

15 + 6 = 21 + 3 = 24 + 6 = 30 + 3 = 33 (4 steps)

16 + 7 = 23 + 5 = 28 + 10 = 38 + 11 = 49 + 13 = 62 + 8 = 70 + 7 = 77 (7 steps)

17 + 8 = 25 + 7 = 32 + 5 = 37 + 10 = 47 + 11 = 58 + 13 = 71 + 8 = 79 + 16 = 95 + 14 = 109 + 10 = 119 + 11 = 130 + 4 = 134 + 8 = 142 + 7 = 149 + 14 = 163 + 10 = 173 + 11 = 184 + 13 = 197 + 17 = 214 + 7 = 221 + 5 = 226 + 10 = 236 + 11 = 247 + 13 = 260 + 8 = 268 + 16 = 284 + 14 = 298 + 19 = 317 + 11 = 328 + 13 = 341 + 8 = 349 + 16 = 365 + 14 = 379 + 19 = 398 + 20 = 418 + 13 = 431 + 8 = 439 + 16 = 455 + 14 = 469 + 19 = 488 + 20 = 508 + 13 = 521 + 8 = 529 + 16 = 545 (44 steps)

18 + 9 = 27 + 9 = 36 + 9 = 45 + 9 = 54 + 9 = 63 + 9 = 72 + 9 = 81 + 9 = 90 + 9 = 99 (9 steps)

19 + 10 = 29 + 11 = 40 + 4 = 44 (3 steps)

20 + 2 = 22

I haven’t looked very thoroughly at this technique, so I don’t know whether it throws up a seemingly unpalindromizable number. If it does, I don’t have an advanced mind, so I won’t be able to prove that it is unpalindromizable. But an adaptation of the technique produces something interesting when it is represented on a graph. This time, if s > 9, where s = digit-sum(n), let s = digit-sum(s) until s <= 9 (i.e, s < 10, the base). I call this the condensed digit-sum:

140 + 5 = 145 + 1 = 146 + 2 = 148 + 4 = 152 + 8 = 160 + 7 = 167 + 5 = 172 + 1 = 173 + 2 = 175 + 4 = 179 + 8 = 187 + 7 = 194 + 5 = 199 + 1 = 200 + 2 = 202 (15 steps)

Here, for comparison, is the sequence for 140 using uncondensed digit-sums:

140 + 5 = 145 + 10 = 155 + 11 = 166 + 13 = 179 + 17 = 196 + 16 = 212 (6 steps)

When all the numbers (including palindromes) created using condensed digit-sums are shown on a graph, they create an interesting pattern in base 10 (the x-axis represents n, the y-axis represents n, n1 = n + digit-sum(n), n2 = n1 + digit-sum(n1), etc):

(Please open images in a new window if they fail to animate.)

digitsum_b10

condensed_b3_to_b20_etc

And here, for comparison, are the patterns created by uncondensed digit-sums in base 2 to 10:

uncondensed_b2_to_b10

Watch this Sbase

In standard notation, there are two ways to represent 2: 10, in base 2, and 2 in every other base. Accordingly, there are three ways to represent 3: 11 in base 2, 10 in base 3, and 3 in every other base. There are four ways to represent 4, five ways to represent 5, and so on. Now, suppose you sum all the digits of all the representations of n in the bases 2 to n, like this:

Σ(2) = 1+02 = 1
Σ(3) = 1+12 + 1+03 = 3 (+2)
Σ(4) = 1+0+02 + 1+13 + 1+04 = 4 (+1)
Σ(5) = 1+0+12 + 1+23 + 1+14 + 1+05 = 8 (+4)
Σ(6) = 1+1+02 + 2+03 + 1+24 + 1+15 + 1+06 = 10 (+2)
Σ(7) = 1+1+12 + 2+13 + 1+34 + 1+25 + 1+16 + 1+07 = 16 (+6)
Σ(8) = 1+0+0+02 + 2+23 + 2+04 + 1+35 + 1+26 + 1+17 + 1+08 = 17 (+1)
Σ(9) = 1+0+0+12 + 1+0+03 + 2+14 + 1+45 + 1+36 + 1+27 + 1+18 + 1+09 = 21 (+4)
Σ(10) = 1+0+1+02 + 1+0+13 + 2+24 + 2+05 + 1+46 + 1+37 + 1+28 + 1+19 + 1+010 = 25 (+4)

It seems reasonable to suppose that as n increases, so the all-digit-sum of n increases. But that isn’t always the case: occasionally it decreases. Here are the sums for n=11..100 (with prime factors when the sum is composite):

Σ(11) = 35 = 5·7 (+10)
Σ(12) = 34 = 2·17 (-1)
Σ(13) = 46 = 2·23 (+12)
Σ(14) = 52 = 22·13 (+6)
Σ(15) = 60 = 22·3·5 (+8)
Σ(16) = 58 = 2·29 (-2)
Σ(17) = 74 = 2·37 (+16)
Σ(18) = 73 (-1)
Σ(19) = 91 = 7·13 (+18)
Σ(20) = 92 = 22·23 (+1)
Σ(21) = 104 = 23·13 (+12)
Σ(22) = 114 = 2·3·19 (+10)
Σ(23) = 136 = 23·17 (+22)
Σ(24) = 128 = 27 (-8)
Σ(25) = 144 = 24·32 (+16)
Σ(26) = 156 = 22·3·13 (+12)
Σ(27) = 168 = 23·3·7 (+12)
Σ(28) = 171 = 32·19 (+3)
Σ(29) = 199 (+28)
Σ(30) = 193 (-6)
Σ(31) = 223 (+30)
Σ(32) = 221 = 13·17 (-2)
Σ(33) = 241 (+20)
Σ(34) = 257 (+16)
Σ(35) = 281 (+24)
Σ(36) = 261 = 32·29 (-20)
Σ(37) = 297 = 33·11 (+36)
Σ(38) = 315 = 32·5·7 (+18)
Σ(39) = 339 = 3·113 (+24)
Σ(40) = 333 = 32·37 (-6)
Σ(41) = 373 (+40)
Σ(42) = 367 (-6)
Σ(43) = 409 (+42)
Σ(44) = 416 = 25·13 (+7)
Σ(45) = 430 = 2·5·43 (+14)
Σ(46) = 452 = 22·113 (+22)
Σ(47) = 498 = 2·3·83 (+46)
Σ(48) = 472 = 23·59 (-26)
Σ(49) = 508 = 22·127 (+36)
Σ(50) = 515 = 5·103 (+7)
Σ(51) = 547 (+32)
Σ(52) = 556 = 22·139 (+9)
Σ(53) = 608 = 25·19 (+52)
Σ(54) = 598 = 2·13·23 (-10)
Σ(55) = 638 = 2·11·29 (+40)
Σ(56) = 634 = 2·317 (-4)
Σ(57) = 670 = 2·5·67 (+36)
Σ(58) = 698 = 2·349 (+28)
Σ(59) = 756 = 22·33·7 (+58)
Σ(60) = 717 = 3·239 (-39)
Σ(61) = 777 = 3·7·37 (+60)
Σ(62) = 807 = 3·269 (+30)
Σ(63) = 831 = 3·277 (+24)
Σ(64) = 819 = 32·7·13 (-12)
Σ(65) = 867 = 3·172 (+48)
Σ(66) = 861 = 3·7·41 (-6)
Σ(67) = 927 = 32·103 (+66)
Σ(68) = 940 = 22·5·47 (+13)
Σ(69) = 984 = 23·3·41 (+44)
Σ(70) = 986 = 2·17·29 (+2)
Σ(71) = 1056 = 25·3·11 (+70)
Σ(72) = 1006 = 2·503 (-50)
Σ(73) = 1078 = 2·72·11 (+72)
Σ(74) = 1114 = 2·557 (+36)
Σ(75) = 1140 = 22·3·5·19 (+26)
Σ(76) = 1155 = 3·5·7·11 (+15)
Σ(77) = 1215 = 35·5 (+60)
Σ(78) = 1209 = 3·13·31 (-6)
Σ(79) = 1287 = 32·11·13 (+78)
Σ(80) = 1263 = 3·421 (-24)
Σ(81) = 1293 = 3·431 (+30)
Σ(82) = 1333 = 31·43 (+40)
Σ(83) = 1415 = 5·283 (+82)
Σ(84) = 1368 = 23·32·19 (-47)
Σ(85) = 1432 = 23·179 (+64)
Σ(86) = 1474 = 2·11·67 (+42)
Σ(87) = 1530 = 2·32·5·17 (+56)
Σ(88) = 1530 = 2·32·5·17 (=)
Σ(89) = 1618 = 2·809 (+88)
Σ(90) = 1572 = 22·3·131 (-46)
Σ(91) = 1644 = 22·3·137 (+72)
Σ(92) = 1663 (+19)
Σ(93) = 1723 (+60)
Σ(94) = 1769 = 29·61 (+46)
Σ(95) = 1841 = 7·263 (+72)
Σ(96) = 1784 = 23·223 (-57)
Σ(97) = 1880 = 23·5·47 (+96)
Σ(98) = 1903 = 11·173 (+23)
Σ(99) = 1947 = 3·11·59 (+44)
Σ(100) = 1923 = 3·641 (-24)

The sum usually increases, occasionally decreases. In one case, when 87 = n = 88, it stays the same. This also happens when 463 = n = 464, where Σ(463) = Σ(464) = 39,375. Does it happen again? I don’t know. The ratio of sum-ups to sum-downs seems to tend towards 3:1. Is that the exact ratio at infinity? I don’t know. Watch this sbase.