construction of magic square of odd length

The construction of an n×n magic squareMathworldPlanetmath with n being odd is simple. (The letter x will be used as a placeholder).

First, place the number 1 in the middle square of the top row.


The 2 goes in the bottommost row, in the column to the right of the one where we put the 1. Each subsequent number goes in the row above, in the column to the right, wrapping around as needed.


But if that spot already has a number, the next number goes in the square below instead.


And so on and so forth. Of course this procedure can be rotated.

Title construction of magic square of odd length
Canonical name ConstructionOfMagicSquareOfOddLength
Date of creation 2013-03-22 16:25:19
Last modified on 2013-03-22 16:25:19
Owner PrimeFan (13766)
Last modified by PrimeFan (13766)
Numerical id 5
Author PrimeFan (13766)
Entry type Algorithm
Classification msc 05B15