How does the Siamese method to construct any size of n-odd magic squares work?

3.9k Views Asked by At

A Magic Square of order n is an arrangement of $n^2$ numbers, usually distinct integers, in a square, such that the n numbers in all rows, all columns, and both diagonals sum to the same constant.

To construct Magic Squares of n-odd size, a method known as Siamese method is given on Wikipedia, the method is ::

starting from the central box of the first row with the number 1 (or
the first number of any arithmetic progression), the fundamental 
movement for filling the boxes is diagonally up and right (↗), one step
at a time. When a move would leave the square, it is wrapped around to 
the last row or first column, respectively.

If a filled box is encountered, one moves vertically down one box (↓)    
instead, then continuing as before.

enter image description here

How does this method work?

2

There are 2 best solutions below

0
On BEST ANSWER

There is a detailed discussion of "the Siamese method," with proofs, at this website. There's also a proof here.

2
On

The basic idea is that you divide the numbers from $1$ to $n^2$ into blocks $(1,n), (n+1,2n), (2n+1,3n) \ldots (n^2-n+1,n^2)$ and think of them as $0+(1,n), n+(1,n), 2n+(1,n) \ldots n(n-1)+(1,n)$. Then you want each row to get each of $(1,n)$ and each column to get each of $(1,n)$. The various runs of $n$ numbers start one in each row and each column, so they each go one per row and column. Each multiple of $n$ also goes one per row and column. It is a Greco-Latin square, if you make the Greek letters correspond to $(1,n)$ and the Latin letters correspond to $(0,(n-1)n)$