# Solve a magic square

A magic square is a game in which all the rows, columns and diagonals of a square add up to the same number. You can easily solve these magic squares following either of these procedures:

## Magic squares of odd number of rows and columns

If the magic square has an odd number of rows and columns, place number 1 in the top central square and then continue placing the next number in the top right direction. If the square is out of the square, continue from the bottom or from the left; if the square is already occupied, place the next number below the last you have written.

## Magic squares of even number of rows and columns

If the magic square has an even number of rows and columns, the trick is this: write the numbers as if you were numbering the squares from left to right and then exchange the numbers in the diagonals.

It is quite easy.

Knowledge + Mathematics