8 | 1 | 6 |
3 | 5 | 7 |
4 | 9 | 2 |
A magic square is an nxn box that is constructed so that every row, column, and horizontal sum to the same number, called the magic number. If a magic square has the same sum for all rows and columns, but not the two horizontals, it is called a semi-magic square. There are also some squares that every row, column, and horizontal have the same product.
At this website is one of the many mathematical proofs behind magic squares. It shows how to find the magic number for any additive magic square.