1266 - Magic Square
Difficulty : easy
Solution Description :
Magic Square Problem
The Siamese method, or De la Loubère method, is a simple method to construct any size of n-odd magic squares.
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
Order-3 magic squares
Order-5 magic squares
| Step 5 |
---|
| | 1 | 8 | 15 | | 5 | 7 | 14 | | 4 | 6 | 13 | | | 10 | 12 | | | 3 | 11 | | | 2 | 9 |
| Step 6 |
---|
17 | 24 | 1 | 8 | 15 | 23 | 5 | 7 | 14 | 16 | 4 | 6 | 13 | 20 | 22 | 10 | 12 | 19 | 21 | 3 | 11 | 18 | 25 | 2 | 9 |
|
-adopt from Wikipedia