Magic square
Appearance
A magic square is an n-by-n matrix containing the numbers 1, 2,..., n2 such that the sum of any row, column or main diagonal yields the same result. All these sums are then necessarily equal to n × (n2 + 1) / 2.
The original magic square is the 3×3 one:
8 1 6 3 5 7 4 9 2
Magic squares of odd order can be constructed by starting in the middle of the top row and going up and to the right, considering the edges joined, or if that is already occupied, going down, writing consecutively increasing numbers. The 5×5 square so constructed looks like this:
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