Conway's LUX method for magic squares is an
algorithm
In mathematics and computer science, an algorithm () is a finite sequence of rigorous instructions, typically used to solve a class of specific problems or to perform a computation. Algorithms are used as specifications for performing ...
by
John Horton Conway
John Horton Conway (26 December 1937 – 11 April 2020) was an English mathematician active in the theory of finite groups, knot theory, number theory, combinatorial game theory and coding theory. He also made contributions to many branches ...
for creating
magic squares of order 4''n''+2, where ''n'' is a
natural number
In mathematics, the natural numbers are those numbers used for counting (as in "there are ''six'' coins on the table") and ordering (as in "this is the ''third'' largest city in the country").
Numbers used for counting are called ''cardinal ...
.
Method
Start by creating a (2''n''+1)-by-(2''n''+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
The Siamese method, or De la Loubère method, is a simple method to construct any size of ''n''-odd magic squares (i.e. number squares in which the sums of all rows, columns and diagonals are identical). The method was brought to France in 1688 by ...
: 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.
:
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.
:
See also
*
Siamese method
The Siamese method, or De la Loubère method, is a simple method to construct any size of ''n''-odd magic squares (i.e. number squares in which the sums of all rows, columns and diagonals are identical). The method was brought to France in 1688 by ...
*
Strachey method for magic squares
References
*{{citation, title=Aha! Solutions, series=MAA Spectrum, first=Martin, last=Erickson, publisher=
Mathematical Association of America, year=2009, isbn=9780883858295, page=98, url=https://books.google.com/books?id=ywKyQz7_4-MC&pg=PA98.
Magic squares