A magic square is an &nbsp; <big>'''NxN'''</big> &nbsp; square matrix whose numbers (usually integers) consist of consecutive numbers arranged so that the sum of each row and column, &nbsp; ''and'' &nbsp; both long (main) diagonals are equal to the same sum (which is called the &nbsp; ''magic number'' &nbsp; or &nbsp; ''magic constant'').

The numbers are usually (but not always) the first &nbsp; '''N'''<sup>2</sup> &nbsp; positive integers.

A magic square whose rows and columns add up to a magic number but whose main diagonals do not, is known as a ''semimagic square''.

{| class="wikitable" style="float:right;border: 4px solid blue; background:lightgreen; color:black; margin-left:auto;margin-right:auto;text-align:center;width:15em;height:15em;table-layout:fixed;font-size:150%"
|-
| <big><big>'''8'''</big></big> || <big><big>'''1'''</big></big> || <big><big>'''6'''</big></big>
|-
| <big><big>'''3'''</big></big> || <big><big>'''5'''</big></big> || <big><big>'''7'''</big></big>
|-
| <big><big>'''4'''</big></big> || <big><big>'''9'''</big></big> || <big><big>'''2'''</big></big>
|}


;Task

For any odd &nbsp; '''N''', &nbsp; [[wp:Magic square#Method_for_constructing_a_magic_square_of_odd_order|generate a magic square]] with the integers &nbsp; ''' 1''' ──► '''N''', &nbsp; and show the results here.

Optionally, show the ''magic number''.

You should demonstrate the generator by showing at least a magic square for &nbsp; '''N''' = '''5'''.


; Related tasks
* [[Magic squares of singly even order]]
* [[Magic squares of doubly even order]]<br><br>


; See also:
* MathWorld&trade; entry: [http://mathworld.wolfram.com/MagicSquare.html Magic_square]
* [http://www.1728.org/magicsq1.htm Odd Magic Squares (1728.org)]<br><br>
