Conway's LUX method for magic squares


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 natural number.

Method

Start by creating a -by- square array consisting of
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: 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.