- Creation of a magic square.
- Discovering/proving
*tiny*theorems about a magic square.

How might others use this page?

- A teacher of XHTML/JavaScript might welcome interesting examples as vehicles for exercising XHTML/JavaScript.
- A teacher of primary/secondary/undergrudate mathematics might welcome the superstructure of this page.
- A teacher might import the ideas from a WWW page to a whiteboard in exposition of some topic.

We can arrange the digits as a 3-by-3 square:-

This button allows you to re-arrange the digits in the square in many ways:-- in the background, so to speak, in the source code;
- in the foreground, so to speak, in the JavaScript Workspace below.

We wish to arrange the digits in the square so that the rows, columns and diagonals have *equal sums*. Hence, because the sum of the integers in all three rows is 45, we shall want the row-sums (and the row-columns and the diagonal-sums) to be 15. We shall call such a square a *magic square*.

*Exercise*. Generate a random square (above).
Is its a *magic square*? Do *any* of the rows/columns/diagonals sum to 15?

I discovered these trios of digits (eight of them) which sum to 15:-

1 + 5 + 9 = 15 1 + 6 + 8 = 15 2 + 4 + 9 = 15 2 + 5 + 8 = 15 2 + 6 + 7 = 15 3 + 4 + 8 = 15 3 + 5 + 7 = 15 4 + 5 + 6 = 15

*Note*:-

- 5 occurs in four trios. In such trios, two have 5 and two odd integers, and two have 5 and two even integers.
- Each even integer occurs in three trios, and one of the three trios includes a 5 (2 5 8, 4 5 6)

Hence, to construct a *magic square*:-

- Place 5 in the centre.
- Place 2 & 8 at diagonal corners, and 4 & 6 at diagonal corners.
- Place the odd numbers at appropriate midpoints of the sides of the square.

- Rotate the magic square 180 degrees about a diagonal in the page through the centre of the square.
- Rotate the magic square 180 degrees about a centre-row or centre-column in the page through the centre of the square.
- Rotate the magic square 90 degrees about an axis perpendicular to the page through the centre of the square.

*Query*. Is there only *one* magic square?

*Theorem 1*. The digit in the centre *must be 5*.

*Proof of Theorem 1*. Try any digit other than 5 in the centre. For example, place 4 in the centre. Then 1 must be on the perimeter of the square; and it will need 10 at its opposite point to make a sum of 15! For a second example, place 6 in the centre. Then 9 must be on the perimeter of the square; and any digit at its opposite will make the sum more than 15.

*Theorem 2*. A digit at a corner of the magic square must be even.

*Proof of Theorem 2*. .............

*Theorem 3*. A digit at the midpoint of a row or column of a magic square must be odd.

*Proof of Theorem 3*. .............

*Theorem 4*. There is *only one* 3-by-3 magic square.

*Proof of Theorem 4*. .........