# Seki

The Japanese mathematician Takakazu Seki (1642 - 1708) designed a method to create multi-bordered magic squares of odd order. The method will be explained using the order n=9. With n=2k+1 this results in k=4.

The entire outer border comprises a total of 4 · (n − 1) numbers. In this example, this results in 2n − 2=16 numbers and their complements, which must first be suitably placed in the border. Seki uses the following steps:

• The number 1 is always placed directly to the left of the upper right corner.
• This number is followed by k − 1 numbers, which are entered from the lower right corner upwards.
• Further k − 1 numbers are placed in the upper row to the left of the 1, continuously move to the left.
• The next single number follows the vertical sequence already entered in the right column.
• Now k numbers are entered in the left column from the center cell upwards.
• Finally, the next k numbers are placed in the bottom row from the left neighbor of the center cell to the left.
•  7 6 5 1 8 4 3 2
•  7 6 5 1 12 11 10 9 8 4 3 16 15 14 13 2

The border is thus clearly defined, and the cells that are still empty are filled with the complementary values ​​to the numbers already entered. As usual, the number complementary to a number x is calculated with n2 + 1 − x. This means:

• Numbers in the corners are complementary to the numbers in the diagonally opposite corners.
• Numbers in rows or columns are complementary to the number directly opposite in the row or column.
 80 67 68 69 7 6 5 1 66 12 70 11 71 10 72 9 73 74 8 78 4 79 3 16 15 14 13 76 77 78 81 2

This method can now be continued from the outer border towards the center. The inner square of order 7, which has not yet been filled, contains a total of 4 · (7 − 1)=24 cells, half of which are filled with complementary numbers. So 12 numbers in the range 17 … 28 must be placed together with their complements.

•  80 67 68 69 7 6 5 1 66 12 21 20 17 70 11 25 71 10 24 72 9 23 73 74 22 8 78 19 4 79 28 27 26 18 3 16 15 14 13 75 76 77 81 2
•  80 67 68 69 7 6 5 1 66 12 64 55 56 21 20 17 54 70 11 25 57 71 10 24 58 72 9 23 59 73 74 60 22 8 78 63 19 4 79 28 27 26 61 62 65 18 3 16 15 14 13 75 76 77 81 2

Do the same with the remaining squares until you finally get the multi-bordered magic square from Seki.

•  80 67 68 69 7 6 5 1 66 12 64 55 56 21 20 17 54 70 11 25 52 47 31 29 46 57 71 10 24 34 44 37 42 48 58 72 9 23 33 39 41 43 49 59 73 74 60 50 40 45 38 32 22 8 78 63 36 35 51 53 30 19 4 79 28 27 26 61 62 65 18 3 16 15 14 13 75 76 77 81 2
•  80 67 68 69 7 6 5 1 66 12 64 55 56 21 20 17 54 70 11 25 52 47 31 29 46 57 71 10 24 34 44 37 42 48 58 72 9 23 33 39 41 43 49 59 73 74 60 50 40 45 38 32 22 8 78 63 36 35 51 53 30 19 4 79 28 27 26 61 62 65 18 3 16 15 14 13 75 76 77 81 2

With this method from Seki, bordered magic squares can be created for all odd orders. Two other examples for n=5 and n=7 are shown in the following figure.

•  24 19 3 1 18 6 16 9 14 20 5 11 13 15 21 22 12 17 10 4 8 7 23 25 2
•  48 39 40 5 4 1 38 9 36 31 15 13 30 41 8 18 28 21 26 32 42 7 17 23 25 27 33 43 44 34 24 29 22 16 6 47 20 19 35 37 14 3 12 11 10 45 46 49 2