Conway's LUX method for magic squares
Encyclopedia
Conway's LUX method for magic squares is an algorithm
Algorithm
In mathematics and computer science, an algorithm is an effective method expressed as a finite list of well-defined instructions for calculating a function. Algorithms are used for calculation, data processing, and automated reasoning...

 by John Horton Conway
John Horton Conway
John Horton Conway is a prolific mathematician active in the theory of finite groups, knot theory, number theory, combinatorial game theory and coding theory...

 for creating magic square
Magic square
In recreational mathematics, a magic square of order n is an arrangement of n2 numbers, usually distinct integers, in a square, such that the n numbers in all rows, all columns, and both diagonals sum to the same constant. A normal magic square contains the integers from 1 to n2...

s of order 4n+2, where n is a natural number
Natural number
In mathematics, the natural numbers are the ordinary whole numbers used for counting and ordering . These purposes are related to the linguistic notions of cardinal and ordinal numbers, respectively...

.

Method

Start by creating a (2n+1)-by-(2n+1) square array consisting of
  • n+1 rows of Ls,
  • 1 row of Us, and
  • n-1 rows of Xs,

and then exchange the U in the middle with the L above it.

Each letter represents a 2x2 block of numbers in the finished square.

Now replace each letter by four consecutive numbers, starting with 1, 2, 3, 4 in the centre square of the top row, and moving from block to block in the manner of the Siamese method
Siamese method
The Siamese method, or De la Loubère method, is a simple method to construct any size of n-odd magic squares . The method was brought to France in 1688 by the French mathematician and diplomat Simon de la Loubère, as he was returning from his 1687 embassy to the kingdom of Siam...

: move up and right, wrapping around the edges, and move down whenever you are obstructed. Fill each 2x2 block according to the order prescribed by the letter:

Example

Let n = 2, so that the array is 5x5 and the final square is 10x10.
L L L L L
L L L L L
L L U L L
U U L U U
X X X X X


Start with the L in the middle of the top row, move to the 4th X in the bottom row, then to the U at the end of the 4th row, then the L at the beginning of the 3rd row, etc.
68 65 96 93 4 1 32 29 60 57
66 67 94 95 2 3 30 31 58 59
92 89 20 17 28 25 56 53 64 61
90 91 18 19 26 27 54 55 62 63
16 13 24 21 49 52 80 77 88 85
14 15 22 23 50 51 78 79 86 87
37 40 45 48 76 73 81 84 9 12
38 39 46 47 74 75 82 83 10 11
41 44 69 72 97 100 5 8 33 36
43 42 71 70 99 98 7 6 35 34
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK