Square on a Three String

222 A.D. was the year in which the Emperor Heliogabalus was assassinated by his own soldiers. Exactly 1666 years later, the Anglo-Dutch classicist Sir Lawrence Alma-Tadema exhibited his painting The Roses of Heliogabalus (1888). I suggested in “Roses Are Golden” that Alma-Tadema must have chosen the year as deliberately as he chose the dimensions of his canvas, which, at 52″ x 84 1/8“, is an excellent approximation to the golden ratio.

But did Alma-Tadema know that lines at 0º and 222º divide a circle in the golden ratio? He could easily have done, just as he could easily have known that 222 precedes the 48th prime, 223. But it is highly unlikely that he knew that 223 yields a magic square whose columns, rows and diagonals all sum to 222. To create the square, simply list the 222 multiples of the reciprocal 1/223 in base 3, or ternary. The digits of the reciprocal repeat after exactly 222 digits and its multiples begin and end like this:

001/223 = 0.00001002102101021212111012022211122022... in base 3
002/223 = 0.00002011211202120201222101122200021121...
003/223 = 0.00010021021010212121110120222111220221...
004/223 = 0.00011100200112011110221210022100120020...
005/223 = 0.00012110002220110100102222122012012120...

[...]

218/223 = 0.22210112220002112122120000100210210102... in base 3
219/223 = 0.22211122022110211112001012200122102202...
220/223 = 0.22212201201212010101112102000111002001...
221/223 = 0.22220211011020102021000121100022201101...
222/223 = 0.22221220120121201010111210200011100200...

Each column, row and diagonal of ternary digits sums to 222. Here is the full n/223 square represented with 0s in grey, 1s in white and 2s in red:

(Click for larger)


It isn’t difficult to see that the white squares are mirror-symmetrical on a horizontal axis. Here is the symmetrical pattern rotated by 90º:

(Click for larger)


But why should the 1s be symmetrical? This isn’t something special to 1/223, because it happens with prime reciprocals like 1/7 too:

1/7 = 0.010212... in base 3
2/7 = 0.021201...
3/7 = 0.102120...
4/7 = 0.120102...
5/7 = 0.201021...
6/7 = 0.212010...

And you can notice something else: 0s mirror 2s and 2s mirror 0s. A related pattern appears in base 10:

1/7 = 0.142857...
2/7 = 0.285714...
3/7 = 0.428571...
4/7 = 0.571428...
5/7 = 0.714285...
6/7 = 0.857142...

The digit 1 in the decimal digits of n/7 corresponds to the digit 8 in the decimal digits of (7-n)/7; 4 corresponds to 5; 2 corresponds to 7; 8 corresponds to 1; 5 corresponds to 4; and 7 corresponds to 2. In short, if you’re given the digits d1 of n/7, you know the digits d2 of (n-7)/7 by the rule d2 = 9-d1.

Why does that happen? Examine these sums:

 1/7 = 0.142857142857142857142857142857142857142857...
+6/7 = 0.857142857142857142857142857142857142857142...
 7/7 = 0.999999999999999999999999999999999999999999... = 1.0

 2/7 = 0.285714285714285714285714285714285714285714...
+5/7 = 0.714285714285714285714285714285714285714285...
 7/7 = 0.999999999999999999999999999999999999999999... = 1.0

 3/7 = 0.428571428571428571428571428571428571428571...
+4/7 = 0.571428571428571428571428571428571428571428...
 7/7 = 0.999999999999999999999999999999999999999999... = 1.0

And here are the same sums in ternary (where the first seven integers are 1, 2, 10, 11, 12, 20, 21):

  1/21 = 0.010212010212010212010212010212010212010212...
+20/21 = 0.212010212010212010212010212010212010212010...
 21/21 = 0.222222222222222222222222222222222222222222... = 1.0

  2/21 = 0.021201021201021201021201021201021201021201...
+12/21 = 0.201021201021201021201021201021201021201021...
 21/21 = 0.222222222222222222222222222222222222222222... = 1.0

 10/21 = 0.102120102120102120102120102120102120102120...
+11/21 = 0.120102120102120102120102120102120102120102...
 21/21 = 0.222222222222222222222222222222222222222222... = 1.0

Accordingly, in base b with the prime p, the digits d1 of n/p correspond to the digits (p-n)/p by the rule d2 = (b-1)-d1. This explains why the 1s mirror themselves in ternary: 1 = 2-1 = (3-1)-1. In base 5, the 2s mirror themselves by the rule 2 = 4-2 = (5-1) – 2. In all odd bases, some digit will mirror itself; in all even bases, no digit will. The mirror-digit will be equal to (b-1)/2, which is always an integer when b is odd, but never an integer when b is even.

Here are some more examples of the symmetrical patterns found in odd bases:

Patterns of 1s in 1/19 in base 3


Patterns of 6s in 1/19 in base 13


Patterns of 7s in 1/19 in base 15


Elsewhere other-posted:

Roses Are Golden — more on The Roses of Heliogabalus (1888)
Three Is The Key — more on the 1/223 square

Advertisements

Get Your Ox Off

Boustrophedon (pronounced “bough-stra-FEE-dun” or “boo-stra-FEE-dun”) is an ancient Greek word literally meaning “as the ox turns (in ploughing)”, that is, moving left-right, right-left, and so on. The word is used of writing that runs down the page in the same way. To see what that means, examine two versions of the first paragraph of Clark Ashton Smith’s story “The Demon of the Flower” (1933). The first is written in the usual way, the second is written boustrophedon:

Not as the plants and flowers of Earth, growing peacefully beneath a simple sun, were the blossoms of the planet Lophai. Coiling and uncoiling in double dawns; tossing tumultuously under vast suns of jade green and balas-ruby orange; swaying and weltering in rich twilights, in aurora-curtained nights, they resembled fields of rooted servants that dance eternally to an other-worldly music.


Not as the plants and flowers of Earth, growing peacefully
.iahpoL tenalp eht fo smossolb eht erew ,nus elpmis a htaeneb
Coiling and uncoiling in double dawns; tossing tumultuously
;egnaro ybur-salab dna neerg edaj fo snus tsav rednu
swaying and weltering in rich twilights, in aurora-curtained
ecnad taht stnavres detoor fo sdleif delbmeser yeht ,sthgin
eternally to an other-worldly music.


Boustrophedon writing was once common and sometimes the left-right lines would also be mirror-reversed, like this:
CAS_text1


You could also use the term “boustrophedon” to describe the way this table of numbers is filled:

primes_table


The table begins with “1” in the top left-hand corner, then moves right for “2”, then down for “3”, then right-and-up for “4”, “5” and “6”, then right for “7”, then left-and-down for “8”, “9” and “10”, and so on. You could also say that the numbers snake through the table. I’ve marked the primes among them, because I was interested in the patterns made by the primes when the numbers were represented as blocks on a grid, like this:

primes_large


Primes are in solid white (compare the Ulam spiral). Here’s the boustrophedon prime-grid on a finer scale:

primes

(click for full image)


And what about other number-tests? Here are the even numbers marked on the grid (i.e. n mod 2 = 0):

mod2

n mod 2 = 0


And here are some more examples of a modulus test:

mod3

n mod 3 = 0


mod5

n mod 5 = 0


mod9

n mod 9 = 0


mod15

n mod 15 = 0


mod_various

n mod various = 0 (animated gif)


Next I looked at reciprocals (numbers divided into 1) marked on the grid, with the digits of a reciprocal marking the number of blank squares before a square is filled in (if the digit is “0”, the square is filled immediately). For example, in base ten 1/7 = 0.142857142857142857…, where the block “142857” repeats for ever. When represented on the grid, 1/7 has 1 blank square, then a filled square, then 4 blank squares, then a filled square, then 2 blank squares, then a filled square, and so on:

recip7_base10

1/7 in base 10


And here are some more reciprocals (click for full images):

recip9_base2

1/9 in base 2


recip13_base10

1/13 in base 10


recip27_base10

1/27 in base 10


recip41_base10

1/41 in base 10


recip63_base10

1/63 in base 10


recip82_base10

1/82 in base 10


recip101_base10

1/101 in base 10


recip104_base10

1/104 in base 10


recip124_base10

1/124 in base 10


recip143_base10

1/143 in base 10


recip175_base10

1/175 in base 10


recip604_base8

1/604 in base 8


recip_various

1/n in various bases (animated gif)


Prime Time

1/29[b=2] = 0·0000100011010011110111001011… (l=28)
1/29[b=3] = 0·0002210102011122200121202111… (l=28)
1/29[b=5] = 0·00412334403211… (l=14)
1/29[b=7] = 0·0145536… (l=7)
1/29[b=11] = 0·04199534608387[10]69115764[10]2723… (l=28)
1/29[b=13] = 0·05[10]9[11]28[12]7231[10]4… (l=14)
1/29[b=17] = 0·09[16]7… (l=4)
1/29[b=19] = 0·0[12]89[15][13][14]7[16]73[17][13]1[18]6[10]9354[11]2[11][15]15[17]… (l=28)
1/29[b=23] = 0·0[18]5[12][15][19][19]… (l=7)
1/29[b=29] = 0·1 (l=1)
1/29[b=31] = 0·1248[17]36[12][25][20]9[19]7[14][29][28][26][22][13][27][24][18]5[10][21][11][23][16]… (l=28)
1/29[b=37] = 0·1[10]7[24]8[34][16][21][25][19]53[30][22][35][26][29][12][28]2[20][15][11][17][31][33]6[14]… (l=28)
1/29[b=41] = 0·1[16][39][24]… (l=4)
1/29[b=43] = 0·1[20][32][26][29][28]7[17][34]4[19][11][37]2[41][22][10][16][13][14][35][25]8[38][23][31]5[40]… (l=28)
1/29[b=47] = 0·1[29]84[40][24][14][27][25][43][35][30][37][12][45][17][38][42]6[22][32][19][21]3[11][16]9[34]… (l=28)
1/29[b=53] = 0·1[43][45][36][29][12][42]… (l=7)
1/29[b=59] = 0·2… (l=1)
1/29[b=61] = 0·26[18][56][48][23]8[25][14][44][10][31][33][39][58][54][42]4[12][37][52][35][46][16][50][29][27][21]… (l=28)
1/29[b=67] = 0·2[20][53]9[16][11][36][64][46][13][57][50][55][30]… (l=14)
1/29[b=71] = 0·2[31][58][53][61][14][48][68][39][12][17]9[56][22]… (l=14)
1/29[b=73] = 0·2[37][55][27][50][25][12][42][57][65][32][52][62][67][70][35][17][45][22][47][60][30][15]7[40][20][10]5… (l=28)
1/29[b=79] = 0·2[57][16][27][19]5[35][32][54][38][10][70][65][29][76][21][62][51][59][73][43][46][24][40][68]8[13][49]… (l=28)
1/29[b=83] = 0·2[71][45][65][68][57][20]… (l=7)
1/29[b=89] = 0·36[12][24][49]9[18][36][73][58][27][55][21][42][85][82][76][64][39][79][70][52][15][30][61][33][67][46]… (l=28)
1/29[b=97] = 0·3[33][43][46][80][26][73][56][83][60][20]6[66][86][93][63][53][50][16][70][23][40][13][36][76][90][30][10]… (l=28)

More Narcissisum

The number 23 is special, inter alia, because it’s prime, divisible by only itself and 1. It’s also special because its reciprocal has maximum period. That is, the digits of 1/23 come in repeated blocks of 22, like this:

1/23 = 0·0434782608695652173913  0434782608695652173913  0434782608695652173913…

But 1/23 fails to be special in another way: you can’t sum its digits and get 23:

0 + 4 + 3 + 4 + 7 = 18
0 + 4 + 3 + 4 + 7 + 8 = 26
0 + 4 + 3 + 4 + 7 + 8 + 2 + 6 + 0 + 8 + 6 + 9 + 5 + 6 + 5 + 2 + 1 + 7 + 3 + 9 + 1 + 3 = 99

1/7 is different:

1/7 = 0·142857… → 1 + 4 + 2 = 7

This means that 7 is narcissistic: it reflects itself by manipulation of the digits of 1/7. But that’s in base ten. If you try base eight, 23 becomes narcissistic too (note that 23 = 2 x 8 + 7, so 23 in base eight is 27):

1/27 = 0·02620544131… → 0 + 2 + 6 + 2 + 0 + 5 + 4 + 4 = 27 (base=8)

Here are more narcissistic reciprocals in base ten:

1/3 = 0·3… → 3 = 3
1/7 = 0·142857… → 1 + 4 + 2 = 7
1/8 = 0·125 → 1 + 2 + 5 = 8
1/13 = 0·076923… → 0 + 7 + 6 = 13
1/14 = 0·0714285… → 0 + 7 + 1 + 4 + 2 = 14
1/34 = 0·02941176470588235… → 0 + 2 + 9 + 4 + 1 + 1 + 7 + 6 + 4 = 34
1/43 = 0·023255813953488372093… → 0 + 2 + 3 + 2 + 5 + 5 + 8 + 1 + 3 + 9 + 5 = 43
1/49 = 0·020408163265306122448979591836734693877551… → 0 + 2 + 0 + 4 + 0 + 8 + 1 + 6 + 3 + 2 + 6 + 5 + 3 + 0 + 6 + 1 + 2 = 49
1/51 = 0·0196078431372549… → 0 + 1 + 9 + 6 + 0 + 7 + 8 + 4 + 3 + 1 + 3 + 7 + 2 = 51
1/76 = 0·01315789473684210526… → 0 + 1 + 3 + 1 + 5 + 7 + 8 + 9 + 4 + 7 + 3 + 6 + 8 + 4 + 2 + 1 + 0 + 5 + 2 = 76
1/83 = 0·01204819277108433734939759036144578313253… → 0 + 1 + 2 + 0 + 4 + 8 + 1 + 9 + 2 + 7 + 7 + 1 + 0 + 8 + 4 + 3 + 3 + 7 + 3 + 4 + 9 = 83
1/92 = 0·010869565217391304347826… → 0 + 1 + 0 + 8 + 6 + 9 + 5 + 6 + 5 + 2 + 1 + 7 + 3 + 9 + 1 + 3 + 0 + 4 + 3 + 4 + 7 + 8 = 92
1/94 = 0·01063829787234042553191489361702127659574468085… → 0 + 1 + 0 + 6 + 3 + 8 + 2 + 9 + 7 + 8 + 7 + 2 + 3 + 4 + 0 + 4 + 2 + 5 + 5 + 3 + 1 + 9 + 1 + 4 = 94
1/98 = 0·0102040816326530612244897959183673469387755… → 0 + 1 + 0 + 2 + 0 + 4 + 0 + 8 + 1 + 6 + 3 + 2 + 6 + 5 + 3 + 0 + 6 + 1 + 2 + 2 + 4 + 4 + 8 + 9 + 7 + 9 + 5 = 98


Previously pre-posted (please peruse):

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

Three Is The Key

If The Roses of Heliogabalus (1888) is any guide, Sir Lawrence Alma-Tadema (1836-1912) thought that 222 is a special number. But his painting doesn’t exhaust its secrets. To get to another curiosity of 222, start with 142857. As David Wells puts it in his Penguin Dictionary of Curious and Interesting Numbers (1986), 142857 is a “number beloved of all recreational mathematicians”. He then describes some of its properties, including this:

142857 x 1 = 142857
142857 x 2 = 285714
142857 x 3 = 428571
142857 x 4 = 571428
142857 x 5 = 714285
142857 x 6 = 857142

The multiples are cyclic permutations: the order of the six numbers doesn’t change, only their starting point. Because each row contains the same numbers, it sums to the same total: 1 + 4 + 2 + 8 + 5 + 7 = 27. And because each row begins with a different number, each column contains the same six numbers and also sums to 27, like this:

1 4 2 8 5 7
+ + + + + +
2 8 5 7 1 4
+ + + + + +
4 2 8 5 7 1
+ + + + + +
5 7 1 4 2 8
+ + + + + +
7 1 4 2 8 5
+ + + + + +
8 5 7 1 4 2

= = = = = =

2 2 2 2 2 2
7 7 7 7 7 7

If the diagonals of the square also summed to the same total, the multiples of 142857 would create a full magic square. But the diagonals don’t have the same total: the left-right diagonal sums to 31 and the right-left to 23 (note that 31 + 23 = 54 = 27 x 2).

But where does 142857 come from? It’s actually the first six digits of the reciprocal of 7, i.e. 1/7 = 0·142857… Those six numbers repeat for ever, because 1/7 is a prime reciprocal with maximum period: when you calculate 1/7, all integers below 7 are represented in the remainders. The square of multiples above is simply another way of representing this:

1/7 = 0·142857…
2/7 = 0·285714…
3/7 = 0·428571…
4/7 = 0·571428…
5/7 = 0·714285…
6/7 = 0·857142…
7/7 = 0·999999…

The prime reciprocals 1/17 and 1/19 also have maximum period, so the squares created by their multiples have the same property: each row and each column sums to the same total, 72 and 81, respectively. But the 1/19 square has an additional property: both diagonals sum to 81, so it is fully magic:

01/19 = 0·0 5 2 6 3 1 5 7 8 9 4 7 3 6 8 4 2 1
02/19 = 0·1 0 5 2 6 3 1 5 7 8 9 4 7 3 6 8 4 2…
03/19 = 0·1 5 7 8 9 4 7 3 6 8 4 2 1 0 5 2 6 3…
04/19 = 0·2 1 0 5 2 6 3 1 5 7 8 9 4 7 3 6 8 4…
05/19 = 0·2 6 3 1 5 7 8 9 4 7 3 6 8 4 2 1 0 5…
06/19 = 0·3 1 5 7 8 9 4 7 3 6 8 4 2 1 0 5 2 6…
07/19 = 0·3 6 8 4 2 1 0 5 2 6 3 1 5 7 8 9 4 7…
08/19 = 0·4 2 1 0 5 2 6 3 1 5 7 8 9 4 7 3 6 8…
09/19 = 0·4 7 3 6 8 4 2 1 0 5 2 6 3 1 5 7 8 9…
10/19 = 0·5 2 6 3 1 5 7 8 9 4 7 3 6 8 4 2 1 0…
11/19 = 0·5 7 8 9 4 7 3 6 8 4 2 1 0 5 2 6 3 1…
12/19 = 0·6 3 1 5 7 8 9 4 7 3 6 8 4 2 1 0 5 2…
13/19 = 0·6 8 4 2 1 0 5 2 6 3 1 5 7 8 9 4 7 3…
14/19 = 0·7 3 6 8 4 2 1 0 5 2 6 3 1 5 7 8 9 4…
15/19 = 0·7 8 9 4 7 3 6 8 4 2 1 0 5 2 6 3 1 5…
16/19 = 0·8 4 2 1 0 5 2 6 3 1 5 7 8 9 4 7 3 6…
17/19 = 0·8 9 4 7 3 6 8 4 2 1 0 5 2 6 3 1 5 7…
18/19 = 0·9 4 7 3 6 8 4 2 1 0 5 2 6 3 1 5 7 8

First line = 0 + 5 + 2 + 6 + 3 + 1 + 5 + 7 + 8 + 9 + 4 + 7 + 3 + 6 + 8 + 4 + 2 + 1 = 81

Left-right diagonal = 0 + 0 + 7 + 5 + 5 + 9 + 0 + 3 + 0 + 4 + 2 + 8 + 7 + 5 + 6 + 7 + 5 + 8 = 81

Right-left diagonal = 9 + 9 + 2 + 4 + 4 + 0 + 9 + 6 + 9 + 5 + 7 + 1 + 2 + 4 + 3 + 2 + 4 + 1 = 81

In base 10, this doesn’t happen again until the 1/383 square, whose magic total is 1719 (= 383-1 x 10-1 / 2). But recreational maths isn’t restricted to base 10 and lots more magic squares are created by lots more primes in lots more bases. The prime 223 in base 3 is one of them. Here the first line is

1/223 = 1/220213 = 0·

0000100210210102121211101202221112202
2110211112001012200122102202002122220
2110110201020210001211000222011010010
2222122012012120101011121020001110020
0112011110221210022100120020220100002
0112112021202012221011222000211212212…

The digits sum to 222, so 222 is the magic total for all rows and columns of the 1/223 square. It is also the total for both diagonals, so the square is fully magic. I doubt that Alma-Tadema knew this, because he lived before computers made calculations like that fast and easy. But he was probably a Freemason and, if so, would have been pleased to learn that 222 had a link with squares.