I have been interested in this for a long time, and I have gained something.
Odd order magic square
When n is odd, we call the magic square an odd magic square. It can be realized by Merzirac method and loubere method. According to my research, it is found that a more magical Rubik's Cube can also be constructed through chess posture, so it is named Mafa.
Even order magic square
When n is even, we call the magic square an even magic square. When n is divisible by 4, we call the even magic square a dichotomy magic square. When n is not divisible by 4, we call this even magic square simple even magic square. It can be realized by Hire method, Strachey and YinMagic. Strachey is a single couple model. I modified the double couple (4m order) and made another feasible mathematical model, called spring. YinMagic is a model I designed in 2002. It can generate any even magic square.
Before filling in the magic square, we make the following agreement: if the number is beyond the scope of the magic square, then the magic square is regarded as a graph that can be stretched indefinitely, as shown in the following figure:
Merzirac method for generating magic square
Put 1 in the square in the middle of the first line, and fill in 2, 3, 4… in the upper left. If there is a number in the upper left corner, move down one space to continue filling. The fifth-order magic square generated by Merziral method is as follows:
17 24 1 8 15
23 5 7 14 16
4 6 13 20 22
10 12 19 2 1 3
1 1 18 25 2 9
Generating odd-order magic squares by loubere method
Put 1 in the middle box, and fill in 2, 3, 4 in the upper right … If there are numbers in the upper right corner, move up two boxes to continue filling. The seventh-order magic square generated by Louberel method is as follows:
30 39 48 1 10 19 28
38 47 7 9 18 27 29
46 6 8 17 26 35 37
5 14 16 25 34 36 45
13 15 24 33 42 44 4
2 1 23 32 4 1 43 3 12
22 3 1 40 49 2 1 1 20
Generating odd-order magic squares by horse method
First, put 1 in any box. Go left 1 step, go down two steps to put 2 (called "horse stance just look"), go left 1 step, go down two steps to put 3, and so on. Put n+ 1 (called skip) under n, then put it under 2n according to the above method, and put 2n+ 1 under 2n. The fifth-order magic square generated by Ma method is as follows:
77 58 39 20 1 72 53 34 15
6 68 49 30 1 1 73 63 44 25
16 78 59 40 2 1 2 64 54 35
26 7 69 50 3 1 12 74 55 45
36 17 79 60 4 1 22 3 65 46
37 27 8 70 5 1 32 13 75 56
47 28 18 80 6 1 42 23 4 66
57 38 19 9 7 1 52 33 14 76
67 48 29 10 8 1 62 43 24 5
Generally let the matrix take a step to the left. The horse stance just look can be expressed as 2X+Y, {x ∈ {,}, y ∈ {[0, 1], [0, 1]} {y ∈ {,}, and the corresponding jump of X∈{[2X+Y can The above is an x jump. The Rubik's Cube generated by Mafa is the Devil's Cube.
Generating even-order magic squares by Hire method
Consider the magic square of order n as a matrix, and write it as a, and the numbers in the grid of row I and column J are written as a(i, j). Fill in 1, 2,3, ..., n on the two diagonal lines of A, and then fill in 1, 2,3, ..., n, so that the sum of the numbers in each row and column is n*(n+ 1)/2. The filling method is: line 1 is filled from n to 1, and line 2 to n/2 is filled from 1 (line 2, line 1, line 2, column n 1), and line 2, line n/2+/kloc. The following is the sixth-order filling method:
1 5 4 3 2 6
6 2 3 4 5 1
1 2 3 4 5 6
6 5 3 4 2 1
6 2 4 3 5 1
1 5 4 3 2 6
The following is the eighth-order filling method (after transposition):
1 8 1 1 8 8 8 1
7 2 2 2 7 7 2 7
6 3 3 3 6 3 6 6
5 4 4 4 4 5 5 5
4 5 5 5 5 4 4 4
3 6 6 6 3 6 3 3
2 7 7 7 2 2 7 2
8 1 8 8 1 1 1 8