Constructing Rubik's Cube by Robespa method is a widely circulated mathematical game, which is said to have been discovered as early as Dayu's flood control. The magic square is characterized by an n×n square consisting of natural numbers, which is called an n-order magic square. The sum of the numbers on each row, column and diagonal is equal. When n is odd, we call the magic square an odd magic square. Robert, a Frenchman, summed up the simple and easy method "Roberts method" to construct the magic square of odd-order continuous natural numbers. The picture below shows a fifth-order Rubik's cube arranged by Robespa method. Roberta's mnemonic formula: (Beginners can draw an N×N grid array first) 1 The center of the line-the number 1 is placed obliquely in the middle grid of the first line, so don't forget-it is placed obliquely in the upper right corner, and the numbers are filled in the upper border in turn and written down-if the upper right direction exceeds the upper border, the virtual grid behind the frame is used. Put the number vertically in the grid corresponding to the bottom line, and put it on the left when it comes out of the box on the right-same as above, if it comes out of the box on the right, it will be filled in the next grid based on the position of the virtual grid after it comes out of the box-if the grid above the number {n} has been occupied by other numbers, it will be filled in the grid below the number {n} and repeated. Arrange the remaining n2- 1 numbers according to the following rules: 1) Put each number at the upper right of the previous number; 2) If the cell to put the number has exceeded the top row, it will be placed in the bottom row and still placed in the right column; 3) If the cell to put this number has exceeded the rightmost column, put it in the leftmost column and still put it in the previous row; 4) If the number (for example, 6) is placed in the cell that has exceeded the top row and the rightmost column, it is placed in the cell of the same column in the next row of the previous number (for example, 5); 5) If the cell where the number is to be placed has been filled in, the processing method is the same as 4).
Note: Robel method is only applicable to odd magic squares.