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.