Magic Squares 6 x 6, Interactive Solution, Medjig Method
Introduction
This method is based on a mathematical game called Medjig (author: Willem Barink, editor: PhilosSpiele, published: 2006).
The pieces of the Medjig Puzzle are squares divided in four quadrants on which the numbers 0, 1, 2 and 3 are dotted in all sequences.
There are 18 squares, with each sequence occurring 3 times.
The aim of the puzzle is to take 9 squares out of the collection and arrange them in a 3 x 3 "Medjigsquare" in such a way that each row and column formed by the quadrants sums to 9, along with the two main diagonals.
The Medjig method of constructing a Magic Square of order 6 is as follows:

Construct a 3 x 3 MedjigSquare A (ignoring the original game's limit on the number of available pieces);

Construct a 3 x 3 Magic Square B (only 8 possibilities);

Construct a 6 x 6 Magic Square C based on the relation
c_{j} = b_{i} + n^{2} a_{j},
with i = 1, 2, ... 9 and j = 1, 2, ... 36.


Medjig Pieces

Magic 3 x 3

Medjig Square

Magic Square 6 x 6












Procedure (Hand):

Select a Medjig Piece by means of the left selection button and the position in the Medjig Square by means of the right selection button.

Move the selected Medjig Piece to the selected position in the Medjig Square by pushing the left button 'Transfer'.

Any Medjig Piece in the Medjig Square, selected with the right selection button, can be:
 rotated a quarter turn (clock wise) by clicking the Medjig Piece;
 moved back to its original position by pressing the right button 'Back'.

Select one of the 8 possible 3 x 3 Magic Squares with the middle selection button and confirm the selection by pressing the middle button 'Confirm'.

Press, after completion of the Medjig Square, the button 'Show Square' to calculate and visualize the resulting Magic Square.
If the Medjig Square is incomplete or incorrect a message will appear.

Press the button 'Show Class' to visualize the related Class of 8 squares based on rotation and reflection of Magic Square C.

By pressing the button 'Rotate' the completed Medjig Square can be rotated 90 degrees (clockwise), which will  even with the same 3 x 3 Magic Square  result in another 6 x 6 Magic Square and related Class.
Procedure (Automatic):

Built a Medjig Square as described above, or press the button 'Example', and validate the square by pressing the button ‘Show Square’.

Choose, in the 'Automatic' window of the form, the type of report you want to see: Medjig or Magic Squares.

If you press the button ‘Report’, with all 9 Check Boxes checked (default), the report will contain only the Medjig or Magic Square shown in the form.

By un checking more and more Check Boxes before pressing the button ‘Report’, more and more Medjig or Magic Squares will be generated. Be careful with un checking to many Check Boxes, it might cause a time out error on your computer.
The algorithm used to generate the Magic Squares automatically is described in Section 6.6.2 and is based on the principle of Conditional Sequential Searching.
At start all independent variables have the value resulting from the constructed Medjig Square in the form.
By un checking a Check Box, the independent variables related with the corresponding Piece in the Medjig Square will vary between 0 and 3.
With only Check Box 7, 8 an 9 checked, 808 Medjig Squares will be generated, which are shown in Attachment 6.8.1.
The resulting Magic Squares, based on the 8 possible Magic Squares of the 3^{th} order, are shown in Attachment 6.8.2.
The total number of possible 3 x 3 Medjig Squares for which the rows, columns and main diagonals sum to 9 is 1.740.800.
Have Fun!
