Spiral Artefact

What’s the next number in this sequence of integers?


5, 14, 19, 23, 28, 32, 37, 41, 46, 50, 55... (A227793 at the OEIS)

It shouldn’t be hard to work out that it’s 64 — the sum-of-digits of n is divisible by 5, i.e., digsum(n) mod 5 = 0. Now try summing the numbers in that sequence:


5 + 14 = 19
19 + 19 = 38
38 + 23 = 61
61 + 28 = 89
89 + 32 = 121
121 + 37 = 158
158 + 41 = 199
199 + 46 = 245
[...]

Here are the cumulative sums as another sequence:


5, 19, 38, 61, 89, 121, 158, 199, 245, 295, 350, 414, 483, 556, 634, 716, 803, 894, 990, 1094, 1203, 1316, 1434, 1556, 1683, 1814, 1950, 2090, 2235, 2389, 2548, 2711, 2879, 3051, 3228, 3409, 3595, 3785, 3980, 4183, 4391, 4603, 4820, 5041, 5267, 5497, 5732, 5976, 6225...

And there’s that cumulative-sum sequence represented as a spiral:

Spiral for cumulative sum of n where digsum(n) mod 5 = 0


You can see how the spiral is created by following 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E… from the center:


ZYXWVU
GFEDCT
H432BS
I501AR
J6789Q
KLMNOP

What about other values for the cumulative sums of digsum(n) mod m = 0? Here’s m = 2,3,4,5,6,7:

Spiral for cumulative sum of n where digsum(n) mod 2 = 0
s1 = 2, 4, 6, 8, 11, 13, 15, 17, 19, 20, 22…
s2 = 2, 6, 12, 20, 31, 44, 59, 76, 95, 115… (cumulative sum of s1)


sum of digsum(n) mod 3 = 0
s1 = 3, 6, 9, 12, 15, 18, 21, 24, 27, 30, 33…
s2 = 3, 9, 18, 30, 45, 63, 84, 108, 135, 165…


sum of digsum(n) mod 4 = 0
s1 = 4, 8, 13, 17, 22, 26, 31, 35, 39, 40, 44…
s2 = 4, 12, 25, 42, 64, 90, 121, 156, 195, 235…


sum of digsum(n) mod 5 = 0
s1 = 5, 14, 19, 23, 28, 32, 37, 41, 46, 50, 55…
s2 = 5, 19, 38, 61, 89, 121, 158, 199, 245, 295…


sum of digsum(n) mod 6 = 0
s1 = 6, 15, 24, 33, 39, 42, 48, 51, 57, 60, 66…
s2 = 6, 21, 45, 78, 117, 159, 207, 258, 315, 375…


sum of digsum(n) mod 7 = 0
s1 = 7, 16, 25, 34, 43, 52, 59, 61, 68, 70, 77…
s2 = 7, 23, 48, 82, 125, 177, 236, 297, 365, 435…


The spiral for m = 2 is strange, but the spirals are similar after that. Until m = 8, when something strange happens again:

sum of digsum(n) mod 8 = 0
s1 = 8, 17, 26, 35, 44, 53, 62, 71, 79, 80, 88…
s2 = 8, 25, 51, 86, 130, 183, 245, 316, 395, 475…


Then the spirals return to normal for m = 9, 10:

sum of digsum(n) mod 9 = 0
s1 = 9, 18, 27, 36, 45, 54, 63, 72, 81, 90, 99…
s2 = 9, 27, 54, 90, 135, 189, 252, 324, 405, 495…


sum of digsum(n) mod 10 = 0
s1 = 19, 28, 37, 46, 55, 64, 73, 82, 91, 109, 118…
s2 = 19, 47, 84, 130, 185, 249, 322, 404, 495, 604…


Here’s an animated gif of m = 8 at higher and higher resolution:

sum of digsum(n) mod 8 = 0 (animated gif)


You might think this strange behavior is dependant on the base in which the dig-sum is calculated. It isn’t. Here’s an animated gif for other bases in which the mod-8 spiral behaves strangely:

sum of digsum(n) mod 8 = 0 in base b = 5, 6, 7, 9, 11, 12, 13 (animated gif)


But the mod-8 spiral stops behaving strangely when the spiral is like this, as a diamond:


   W
  XIV
 YJ8HU
ZK927GT
LA3016FS
 MB45ER
  NCDQ
   OP

Now the mod-8 spiral looks like this:

sum of digsum(n) mod 8 = 0 (diamond spiral)


But the mod-4 and mod-9 spirals look like this:

sum of digsum(n) mod 4 = 0 (diamond spiral)


sum of digsum(n) mod 9 = 0 (diamond spiral)


You can also construct the spirals as a triangle, like this:


     U
    VCT
   WD2CS
  XE301AR
 YF456789Q
ZGHIJKLMNOP

Here’s the beginning of the mod-5 triangular spiral:

sum of digsum(n) mod 5 = 0 (triangular spiral) (open in new window for full size)


And the beginning of the mod-8 triangular spiral:

sum of digsum(n) mod 8 = 0 (triangular spiral) (open in new window for full size)


The mod-8 spiral is behaving strangely again. So the strangeness is partly an artefact of the way the spirals are constructed.


Post-Performative Post-Scriptum

“Spiral Artefact”, the title of this incendiary intervention, is of course a tip-of-the-hat to core Black-Sabbath track “Spiral Architect”, off core Black-Sabbath album Sabbath Bloody Sabbath, issued in core Black-Sabbath success-period of 1973.

RevNumSum

If you take an integer, n, and reverse its digits to get the integer r, there are three possibilities:


n > r (e.g. 85236 > 63258)
n < r (e.g. 17783 < 38771)
n = r (e.g. 45154 = 45154)

If n = r, n is a palindrome. If n > r, I call n a major number. If n < r, I call n a minor number. And here are the minor and major numbers represented as white squares on an Ulam-like spiral (the negative of a minor spiral is a major spiral, and vice versa — sometimes one looks better than the other):

b=2 (minor numbers)


b=3


b=4


b=5


b=6


b=7 (major numbers)


b=8 (minor numbers)


b=9 (mjn)


b=10 (mjn)


b=11 (mjn)


b=12 (mjn)


b=13 (mjn)


b=14 (mjn)


b=15 (mjn)


b=16 (mjn)


b=17 (mjn)


b=18 (mjn)


b=19 (mjn)


b=20 (mjn)


Minor numbers, b=2..20 (animated)


Now let’s look at a sequence formed by summing the reversed numbers, minor ones, major ones and palindromes. Here are the standard integers:


1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17...

If you sum the integers, you get what are called the triangular numbers:


1 = 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
66 = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11
78 = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12
91 = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13
105 = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14
120 = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15
136 = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16
153 = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17
171 = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18
190 = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19
210 = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20

But what happens if you reverse the integers before summing them? Here side-by-side are the triangular numbers and the underlined revnumsums (as they might be called):


45 = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9
45 = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9
55 = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10
46 = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 1
66 = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11
57 = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 1 + 11
78 = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12
78 = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 1 + 11 + 21
91 = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13
109 = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 1 + 11 + 21 + 31
105 = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14
150 = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 1 + 11 + 21 + 31 + 41
120 = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15
201 = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 1 + 11 + 21 + 31 + 41 + 51
136 = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16
262 = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 1 + 11 + 21 + 31 + 41 + 51 + 61
153 = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17
333 = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 1 + 11 + 21 + 31 + 41 + 51 + 61 + 71
171 = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18
414 = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 1 + 11 + 21 + 31 + 41 + 51 + 61 + 71 + 81
190 = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19
505 = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 1 + 11 + 21 + 31 + 41 + 51 + 61 + 71 + 81 + 91
210 = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20
507 = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 1 + 11 + 21 + 31 + 41 + 51 + 61 + 71 + 81 + 91
+ 2

Unlike triangular numbers, revnumsums are dependent on the base they’re calculated in. In base 2, the revnumsum is always smaller than the triangular number, except at step 1. In base 3, the revnumsum is equal to the triangular number at steps 1, 2 and 15 (= 120 in base 3). Otherwise it’s smaller than the triangular number.

And in higher bases? In bases > 3, the revnumsum rises and falls above the equivalent triangular number. When it’s higher, it tends towards a maximum height of (base+1)/4 * triangular number.

Palindrought

The alchemists dreamed of turning dross into gold. In mathematics, you can actually do that, metaphorically speaking. If palindromes are gold and non-palindromes are dross, here is dross turning into gold:


22 = 10 + 12
222 = 10 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 23 + 24
484 = 10 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 34
555 = 10 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 34 + 35 + 36
2002 = nonpalsum(10,67)
36863 = nonpalsum(10,286)
45954 = nonpalsum(10,319)
80908 = nonpalsum(10,423)
113311 = nonpalsum(10,501)
161161 = nonpalsum(10,598)
949949 = nonpalsum(10,1417)
8422248 = nonpalsum(10,4136)
13022031 = nonpalsum(10,5138)
14166141 = nonpalsum(10,5358)
16644661 = nonpalsum(10,5806)
49900994 = nonpalsum(10,10045)
464939464 = nonpalsum(10,30649)
523434325 = nonpalsum(10,32519)
576656675 = nonpalsum(10,34132)
602959206 = nonpalsum(10,34902)
[...]

The palindromes don’t seem to stop arriving. But something unexpected happens when you try to turn gold into gold. If you sum palindromes to get palindromes, you’re soon hit by what you might call a palindrought, where no palindromes appear:


1 = 1
3 = 1 + 2
6 = 1 + 2 + 3
111 = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 11 + 22 + 33
353 = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 11 + 22 + 33 + 44 + 55 + 66 + 77
7557 = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 11 + 22 + 33 + 44 + 55 + 66 + 77 + 88 + 99 + 101 + 111 + 121 + 131 + 141 + 151 + 161 + 171 + 181 + 191 + 202 + 212 + 222 + 232 + 242 + 252 + 262 + 272 + 282 + 292 + 303 + 313 + 323 + 333 + 343 + 353 + 363 + 373 + 383
2376732 = palsum(1,21512)

That’s sequence A046488 at the OEIS. And I suspect that the sequence is complete and that the palindrought never ends. For some evidence of that, here’s an interesting pattern that emerges if you look at palsums of 1 to repdigits 9[…]9:


50045040 = palsum(1,99999)
50045045040 = palsum(1,9999999)
50045045045040 = palsum(1,999999999)
50045045045045040 = palsum(1,99999999999)
50045045045045045040 = palsum(1,9999999999999)
50045045045045045045040 = palsum(1,999999999999999)
50045045045045045045045040 = palsum(1,99999999999999999)
50045045045045045045045045040 = palsum(1,9999999999999999999)
50045045045045045045045045045040 = palsum(1,999999999999999999999)

As the sums get bigger, the carries will stop sweeping long enough and the sums may fall into semi-regular patterns of non-palindromic numbers like 50045040. If you try higher bases like base 909, you get more palindromes by summing palindromes, but a palindrought arrives in the end there too:


1 = palsum(1)
3 = palsum(1,2)
6 = palsum(1,3)
A = palsum(1,4)
[...]
66 = palsum(1,[104]) (palindromes = 43)
LL = palsum(1,[195]) (44)
[37][37] = palsum(1,[259]) (45)
[73][73] = palsum(1,[364]) (46)
[114][114] = palsum(1,[455]) (47)
[172][172] = palsum(1,[559]) (48)
[369][369] = palsum(1,[819]) (49)
6[466]6 = palsum(1,[104][104]) (50)
L[496]L = palsum(1,[195][195]) (51)
[37][528][37] = palsum(1,[259][259]) (52)
[73][600][73] = palsum(1,[364][364]) (53)
[114][682][114] = palsum(1,[455][455]) (54)
[172][798][172] = palsum(1,[559][559]) (55)
[291][126][291] = palsum(1,[726][726]) (56)
[334][212][334] = palsum(1,[778][778]) (57)
[201][774][830][774][201] = palsum(1,[605][707][605]) (58)
[206][708][568][708][206] = palsum(1,[613][115][613]) (59)
[456][456][569][569][456][456] = palsum(1,11[455]11) (60)
22[456][454][456]22 = palsum(1,21012) (61)

Note the palindrome for palsum(1,21012). All odd bases higher than 3 seem to produce a palindrome for 1 to 21012 in that base (21012 in base 5 = 1382 in base 10, 2012 in base 7 = 5154 in base 10, and so on):


2242422 = palsum(1,21012) (base=5)
2253522 = palsum(1,21012) (b=7)
2275722 = palsum(1,21012) (b=11)
2286822 = palsum(1,21012) (b=13)
2297922 = palsum(1,21012) (b=15)
22A8A22 = palsum(1,21012) (b=17)
22B9B22 = palsum(1,21012) (b=19)
22CAC22 = palsum(1,21012) (b=21)
22DBD22 = palsum(1,21012) (b=23)

And here’s another interesting pattern created by summing squares in base 9 (where 17 = 16 in base 10, 40 = 36 in base 10, and so on):


1 = squaresum(1)
5 = squaresum(1,4)
33 = squaresum(1,17)
111 = squaresum(1,40)
122221 = squaresum(1,4840)
123333321 = squaresum(1,503840)
123444444321 = squaresum(1,50483840)
123455555554321 = squaresum(1,5050383840)
123456666666654321 = squaresum(1,505048383840)
123456777777777654321 = squaresum(1,50505038383840)
123456788888888887654321 = squaresum(1,5050504838383840)

Then a palindrought strikes again. But you don’t get a palindrought in the triangular numbers, or numbers created by summing the integers, palindromic and non-palindromic alike:


1 = 1
3 = 1 + 2
6 = 1 + 2 + 3
55 = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10
66 = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11
171 = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18
595 = 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
666 = 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
3003 = palsum(1,77)
5995 = palsum(1,109)
8778 = palsum(1,132)
15051 = palsum(1,173)
66066 = palsum(1,363)
617716 = palsum(1,1111)
828828 = palsum(1,1287)
1269621 = palsum(1,1593)
1680861 = palsum(1,1833)
3544453 = palsum(1,2662)
5073705 = palsum(1,3185)
5676765 = palsum(1,3369)
6295926 = palsum(1,3548)
35133153 = palsum(1,8382)
61477416 = palsum(1,11088)
178727871 = palsum(1,18906)
1264114621 = palsum(1,50281)
1634004361 = palsum(1,57166)
5289009825 = palsum(1,102849)
6172882716 = palsum(1,111111)
13953435931 = palsum(1,167053)
16048884061 = palsum(1,179158)
30416261403 = palsum(1,246642)
57003930075 = palsum(1,337650)
58574547585 = palsum(1,342270)
66771917766 = palsum(1,365436)
87350505378 = palsum(1,417972)
[...]

If 617716 = palsum(1,1111) and 6172882716 = palsum(1,111111), what is palsum(1,11111111)? Try it for yourself — there’s an easy formula for the triangular numbers.

Fourtoshiki

I hadn’t realized that sudokus could be witty until earlier this year, when I did one that literally made me laugh, because the solutions were so clever and quirky. Foolishly, I neglected to make a note of the sudoku so I could reproduce it. But I haven’t made that mistake with this futoshiki:

Using more-than and less-than signs to deduce values, fill each line and column with the numbers 1 to 5 so that no number occurs twice in the same row or column

It’s not witty like that lost sudoku, but I think futoshikis are even more beautiful and enjoyable than sudokus, because they’re even more elemental. They’re also rooted in the magic of binary, thanks to the more-than / less-than clues. And when there’s only one number on the original grid, completing them feels like growing a flower from a seed.

The Glamor of Gamma

The factorial function, n!, is easy to understand. You simply take an integer and multiply it by all integers smaller than it (by convention, 0! = 1):

0! = 1
1! = 1
2! = 2 = 2*1
3! = 6 = 3*2*1
4! = 24 = 4*3*2*1
5! = 120 = 5*4*3*2*1
6! = 720 = 6*120 = 6*5!
7! = 5040
8! = 40320
9! = 362880
10! = 3628800
11! = 39916800
12! = 479001600
13! = 6227020800
14! = 87178291200
15! = 1307674368000
16! = 20922789888000
17! = 355687428096000
18! = 6402373705728000
19! = 121645100408832000
20! = 2432902008176640000

The gamma function, Γ(n), isn’t so easy to understand. It allows you to find the factorials of not just the integers, but everything between the integers, like fractions, square roots, and transcendental numbers like π. Don’t ask me how! And don’t ask me how you get this very beautiful and unexpected result:

Γ(1/2) = √π = 1.77245385091...

But a blog called Mathematical Enchantments can tell you more:

The Square Root of Pi


Post-Performative Post-Scriptum

glamour | glamor, n. Originally Scots, introduced into the literary language by Scott. A corrupt form of grammar n.; for the sense compare gramarye n. (and French grimoire ), and for the form glomery n. 1. Magic, enchantment, spell; esp. in the phrase to cast the glamour over one. 2. a. A magical or fictitious beauty attaching to any person or object; a delusive or alluring charm. b. Charm; attractiveness; physical allure, esp. feminine beauty; frequently attributive colloquial (originally U.S.). — Oxford English Dictionary

Russell in Your Head-Roe (Re-Visited)

“Ordinary language is totally unsuited for expressing what physics really asserts, since the words of everyday life are not sufficiently abstract. Only mathematics and mathematical logic can say as little as the physicist means to say.” — Bertrand Russell, The Scientific Outlook (1931)


Previously pre-posted

Russell in Your Head-Roe — Bertrand Russell on mathematics
A Ladd Inane — Bertrand Russell on solipsism
Math Matters — Bertrand Russell on math and physics
Whip Poor Wilhelm — Bertrand Russell on Friedrich Nietzsche

Period Panes

In The Penguin Dictionary of Curious and Interesting Numbers (1987), David Wells remarks that 142857 is “a number beloved of all recreational mathematicians”. He then explains that it’s “the decimal period of 1/7: 1/7 = 0·142857142857142…” and “the first decimal reciprocal to have maximum period, that is, the length of its period is only one less than the number itself.”

Why does this happen? Because when you’re calculating 1/n, the remainders can only be less than n. In the case of 1/7, you get remainders for all integers less than 7, i.e. there are 6 distinct remainders and 6 = 7-1:

(1*10) / 7 = 1 remainder 3, therefore 1/7 = 0·1...
(3*10) / 7 = 4 remainder 2, therefore 1/7 = 0·14...
(2*10) / 7 = 2 remainder 6, therefore 1/7 = 0·142...
(6*10) / 7 = 8 remainder 4, therefore 1/7 = 0·1428...
(4*10) / 7 = 5 remainder 5, therefore 1/7 = 0·14285...
(5*10) / 7 = 7 remainder 1, therefore 1/7 = 0·142857...
(1*10) / 7 = 1 remainder 3, therefore 1/7 = 0·1428571...
(3*10) / 7 = 4 remainder 2, therefore 1/7 = 0·14285714...
(2*10) / 7 = 2 remainder 6, therefore 1/7 = 0·142857142...

Mathematicians know that reciprocals with maximum period can only be prime reciprocals and with a little effort you can work out whether a prime will yield a maximum period in a particular base. For example, 1/7 has maximum period in bases 3, 5, 10, 12 and 17:

1/21 = 0·010212010212010212... in base 3
1/12 = 0·032412032412032412... in base 5
1/7 =  0·142857142857142857... in base 10
1/7 =  0·186A35186A35186A35... in base 12
1/7 =  0·274E9C274E9C274E9C... in base 17

To see where else 1/7 has maximum period, have a look at this graph:

Period pane for primes 3..251 and bases 2..39


I call it a “period pane”, because it’s a kind of window into the behavior of prime reciprocals. But what is it, exactly? It’s a graph where the x-axis represents primes from 3 upward and the y-axis represents bases from 2 upward. The red squares along the bottom aren’t part of the graph proper, but indicate primes that first occur after a power of two: 5 after 4=2^2; 11 after 8=2^3; 17 after 16=2^4; 37 after 32=2^5; 67 after 64=2^6; and so on.

If a prime reciprocal has maximum period in a particular base, the graph has a solid colored square. Accordingly, the purple square at the bottom left represents 1/7 in base 10. And as though to signal the approval of the goddess of mathematics, the graph contains a lower-case b-for-base, which I’ve marked in green. Here are more period panes in higher resolution (open the images in a new window to see them more clearly):

Period pane for primes 3..587 and bases 2..77


Period pane for primes 3..1303 and bases 2..152


An interesting pattern has begun to appear: note the empty lanes, free of reciprocals with maximum period, that stretch horizontally across the period panes. These lanes are empty because there are no prime reciprocals with maximum period in square bases, that is, bases like 4, 9, 25 and 36, where 4 = 2*2, 9 = 3*3, 25 = 5*5 and 36 = 6*6. I don’t know why square bases don’t have max-period prime reciprocals, but it’s probably obvious to anyone with more mathematical nous than me.

Period pane for primes 3..2939 and bases 2..302


Period pane for primes 3..6553 and bases 2..602


Like the Ulam spiral, other and more mysterious patterns appear in the period panes, hinting at the hidden regularities in the primes.

Performativizing Polyhedra

Τα Στοιχεία του Ευκλείδου, ια΄

κεʹ. Κύβος ἐστὶ σχῆμα στερεὸν ὑπὸ ἓξ τετραγώνων ἴσων περιεχόμενον.
κϛʹ. ᾿Οκτάεδρόν ἐστὶ σχῆμα στερεὸν ὑπὸ ὀκτὼ τριγώνων ἴσων καὶ ἰσοπλεύρων περιεχόμενον.
κζʹ. Εἰκοσάεδρόν ἐστι σχῆμα στερεὸν ὑπὸ εἴκοσι τριγώνων ἴσων καὶ ἰσοπλεύρων περιεχόμενον.
κηʹ. Δωδεκάεδρόν ἐστι σχῆμα στερεὸν ὑπὸ δώδεκα πενταγώνων ἴσων καὶ ἰσοπλεύρων καὶ ἰσογωνίων περιεχόμενον.

Euclid’s Elements, Book 11

25. A cube is a solid figure contained by six equal squares.
26. An octahedron is a solid figure contained by eight equal and equilateral triangles.
27. An icosahedron is a solid figure contained by twenty equal and equilateral triangles.
28. A dodecahedron is a solid figure contained by twelve equal, equilateral, and equiangular pentagons.

Thrice Dice Twice

A once very difficult but now very simple problem in probability from Ian Stewart’s Do Dice Play God? (2019):

For three dice [Girolamo] Cardano solved a long-standing conundrum [in the sixteenth century]. Gamblers had long known from experience that when throwing three dice, a total of 10 is more likely than 9. This puzzled them, however, because there are six ways to get a total of 10:

1+4+5; 1+3+6; 2+4+4; 2+2+6; 2+3+5; 3+3+4

But also six ways to get a total of 9:

1+2+6; 1+3+5; 1+4+4; 2+2+5; 2+3+4; 3+3+3

So why does 10 occur more often?

To see the answer, imagine throwing three dice of different colors: red, blue and yellow. How many ways can you get 9 and how many ways can you get 10?

Roll Total=9 Dice #1 (Red) Dice #2 (Blue) Dice #3 (Yellow)
01 9 = 1 2 6
02 9 = 1 3 5
03 9 = 1 4 4
04 9 = 1 5 3
05 9 = 1 6 2
06 9 = 2 1 6
07 9 = 2 2 5
08 9 = 2 3 4
09 9 = 2 4 3
10 9 = 2 5 2
11 9 = 2 6 1
12 9 = 3 1 5
13 9 = 3 2 4
14 9 = 3 3 3
15 9 = 3 4 2
16 9 = 3 5 1
17 9 = 4 1 4
18 9 = 4 2 3
19 9 = 4 3 2
20 9 = 4 4 1
21 9 = 5 1 3
22 9 = 5 2 2
23 9 = 5 3 1
24 9 = 6 1 2
25 9 = 6 2 1
Roll Total=10 Dice #1 (Red) Dice #2 (Blue) Dice #3 (Yellow)
01 10 = 1 3 6
02 10 = 1 4 5
03 10 = 1 5 4
04 10 = 1 6 3
05 10 = 2 2 6
06 10 = 2 3 5
07 10 = 2 4 4
08 10 = 2 5 3
09 10 = 2 6 2
10 10 = 3 1 6
11 10 = 3 2 5
12 10 = 3 3 4
13 10 = 3 4 3
14 10 = 3 5 2
15 10 = 3 6 1
16 10 = 4 1 5
17 10 = 4 2 4
18 10 = 4 3 3
19 10 = 4 4 2
20 10 = 4 5 1
21 10 = 5 1 4
22 10 = 5 2 3
23 10 = 5 3 2
24 10 = 5 4 1
25 10 = 6 1 3
26 10 = 6 2 2
27 10 = 6 3 1