3 3 Magic Squares with Duplicate Digits Allowed
Kirk T. McDonald
Joseph Henry Laboratories, Princeton University, Princeton, NJ 08544
Nancy C. Schaefer
Littlebrook Elementary School, Princeton, NJ 08540
(October 13, 2001)
Problem
Magic squares are n n array of integers for which the sum of the numbers in the columns,
rows and diagonals are all the same. The classic 3 3 magic square that incorporates the
digits 1-9 is shown below:
2 7 6
9 5 1
(1)
4 3 8
Give all possible 3 3 magic squares whose elements are the single digits 1-9, but with
duplicate digits allowed. Thus,
1 1 1
1 1 1
(2)
1 1 1
is the simplest magic square according to the present problem.
Squares that are related by reection about a horizontal, vertical or diagonal axis are not
considered as distinct. That is, the square
2 9 4
7 5 3
(3)
6 1 8
is considered the same as square (1).
Solution
Extensive web sites related to magic squares can be found starting with [1].
We solved the present problem by the method of exhaustion, using a computer program
to carry out the search for 3 3 magic squares. While sums of 3 digits from 1 to 9 range
between 3 and 27, we nd that only sums that are multiples of 3 are associated with magic
squares, and that there are 35 distinct 3 3 magic squares with duplicate digits allowed.
2.1
Sum = 3
There is only 1 magic square for this case:
1 1 1
(4)
1 1 1
1 1 1
2.2
Sum = 6
There are 2 distinct magic square for this case (with a total of 5 if reected squares are
counted as dierent):
2.3
1 3 2
2 2 2
3 2 1
2 2 2
2 1 3
2 2 2
(5)
Sum = 9
There are 4 distinct magic square for this case (with a total of 13 if reected squares are
counted as dierent):
2.4
1 5 3
2 3 4
2 4 3
3 3 3
5 3 1
5 3 1
4 3 2
3 3 3
3 1 5
2 3 4
3 2 4
3 3 3
(6)
Sum = 12
There are 6 distinct magic square for this case (with a total of 25 if reected squares are
counted as dierent):
2.5
1 7 4
2 5 5
2 6 4
3 4 5
3 5 4
4 4 4
7 4 1
7 4 1
6 4 2
6 4 2
5 4 3
4 4 4
4 1 7
3 3 6
4 2 6
3 4 5
4 3 5
4 4 4
(7)
Sum = 15
There are 9 distinct magic square for this case (with a total of 41 if reected squares are
counted as dierent). The second of these is the classic 3 3 magic square.
1 9 5
2 7 6
2 8 5
3 5 7
3 6 6
3 7 5
9 5 1
9 5 1
8 5 2
9 5 1
8 5 2
7 5 3
5 1 9
4 3 8
5 2 8
3 5 7
4 4 7
5 3 7
2.6
4 5 6
4 6 5
5 5 5
7 5 3
6 5 4
5 5 5
4 5 6
5 4 6
5 5 5
(8)
Sum = 18
There are 6 distinct magic square for this case (with a total of 25 if reected squares are
counted as dierent):
2.7
3 9 6
4 7 7
4 8 6
5 6 7
5 7 6
6 6 6
9 6 3
9 6 3
8 6 4
8 6 4
7 6 5
6 6 6
6 3 9
5 5 8
6 4 8
5 6 7
6 5 7
6 6 6
(9)
Sum = 21
There are 4 distinct magic square for this case (with a total of 13 if reected squares are
counted as dierent):
2.8
5 9 7
6 7 8
6 8 7
7 7 7
9 7 5
9 7 5
8 7 6
7 7 7
7 5 9
6 7 8
7 6 8
7 7 7
(10)
Sum = 24
There are 2 distinct magic square for this case (with a total of 5 if reected squares are
counted as dierent):
2.9
7 9 8
8 8 8
9 8 7
8 8 8
8 7 9
8 8 8
(11)
Sum = 27
There is only 1 magic square for this case:
9 9 9
9 9 9
9 9 9
(12)
References
[1] http://forum.swarthmore.edu/alejandre/magic.square.html