There are many formal methods of constructing magic squares.
One of the simplest, devised by de La Loubère, can be used to construct
any
odd order magic square with any
arithmetic
progression (such as 1, 4, 7, 10, 13, 16, ...) in the cells.
We will examine it on a 5 x 5 grid.
Rule 1: 
Place the first number in the middle cell of the top
row. 

Rule 2: 
Successive numbers are inserted into the square in a
diagonal line sloping upwards and to the right. 

Rule 3: 
When the top row is reached, the next number goes in
the bottom row as if it were directly below the top row. 

Rule 4: 
When the right hand column is reached, the next number
goes in the extreme left column as if it were directly to the right of
the right hand column. 

Rule 5: 
When a cell is reached that is already filled, or when
the top right hand cell is reached, the next number drops to the cell directly
below. 

