Conway's LUX method for magic squares
From Wikipedia, the free encyclopedia
Conway's LUX method for magic squares is an algorithm by John Horton Conway for creating magic squares of order 4n+2, where n is a positive natural number.
Algorithm: Start creating an array consisting of
* n+1 rows of Ls * 1 row of Us and * n-1 rows of Xs
all of them with length 2n+1 (square).
Now exchange the U in the middle with the L above it.
Using the Siamese method generate a magic square of order 2n+1 overlaying to the array of letters, start doing this beginning from the center square of the top row. Now fill each square according to the order prescribed by the letter.
Example (Imagine if you would write the letter, the numbers go the way the pencil goes).
L =
4 1 2 3
U =
1 4 2 3
X =
1 4 3 2
An example square, of order 10, follows:
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 68 65 96 93 4 1 32 29 60 57 [2,] 66 67 94 95 2 3 30 31 58 59 [3,] 92 89 20 17 28 25 56 53 64 61 [4,] 90 91 18 19 26 27 54 55 62 63 [5,] 16 13 24 21 49 52 80 77 88 85 [6,] 14 15 22 23 50 51 78 79 86 87 [7,] 37 40 45 48 76 73 81 84 9 12 [8,] 38 39 46 47 74 75 82 83 10 11 [9,] 41 44 69 72 97 100 5 8 33 36 [10,] 43 42 71 70 99 98 7 6 35 34
[edit] See also
This number theory-related article is a stub. You can help Wikipedia by expanding it. |