1. 1
3 × 3 Magic Squares: Curious Facts
Cara Colotti
The properties of magic squares have arisen much curiosity in the field of linear algebra
over the years. In this article we are going to explore two properties of 3x3 magic squares. We
are going to show that if matrix 𝐴 is a 3x3 magic square, then 𝐴3
and 𝐴−1
(if it exists) are also 3x3
magic squares. A magic square is defined as follows: A square matrix with real number entries
such that:
(i) Every row has the same sum,
(ii) Every column has the same sum as every row,
(iii) Each of the two diagonals has the same sum as each row/column sum.
For example, a 3x3 magic square is a square matrix such as
[
8 17 5
7 10 13
15 3 12
]
where each row/column/diagonal sum is 30.
We will now show that the set of all 3x3 magic squares forms a vector space. To show
that a set of 3x3 magic squares forms a vector space we must show that the magic squares satisfy
the following seven properties:
i. Vector addition is commutative for all 𝒗 𝟏, 𝒗 𝟐 ∈ 𝑽, 𝒗 𝟏 + 𝒗 𝟐 = 𝒗 𝟐 + 𝒗 𝟏:
6. 6
So, ( 𝑎𝑏) 𝑣 = ( 𝑎𝑏)[
𝑛𝑖1 𝑛𝑖2 𝑛𝑖3
𝑛𝑗1 𝑛𝑗2 𝑛𝑗3
𝑛 𝑘1 𝑛 𝑘2 𝑛 𝑘3
]=[
𝑎𝑏𝑛𝑖1 𝑎𝑏𝑛𝑖2 𝑎𝑏𝑛𝑖3
𝑎𝑏𝑛𝑗1 𝑎𝑏𝑛𝑗2 𝑎𝑏𝑛𝑗3
𝑎𝑏𝑛 𝑘1 𝑎𝑏𝑛 𝑘2 𝑎𝑏𝑛 𝑘3
] = ( 𝑎)[
𝑏𝑛𝑖1 𝑏𝑛𝑖2 𝑏𝑛𝑖2
𝑏𝑛𝑗1 𝑏𝑛𝑗2 𝑏𝑛𝑗3
𝑏𝑛 𝑘1 𝑏𝑛 𝑘2 𝑏𝑛 𝑘3
]
= (𝑎)(𝑏𝑣)
vii. Scalar multiplication by the number 1 is the identity for all 𝒗 ∈ 𝑽, 𝟏𝒗 = 𝒗
Assume 𝑉 is a 3x3 magic square represented by 𝑣 = [
𝑛𝑖1 𝑛𝑖2 𝑛𝑖3
𝑛𝑗1 𝑛𝑗2 𝑛𝑗3
𝑛 𝑘1 𝑛 𝑘2 𝑛 𝑘3
]. Note that all of the
entries are real numbers. 1𝑣 = (1) [
𝑛𝑖1 𝑛𝑖2 𝑛𝑖3
𝑛𝑗1 𝑛𝑗2 𝑛𝑗3
𝑛 𝑘1 𝑛 𝑘2 𝑛 𝑘3
] = [
(1) 𝑛𝑖1 (1) 𝑛𝑖2 (1) 𝑛𝑖3
(1) 𝑛𝑗1 (1) 𝑛𝑗2 (1) 𝑛 𝑗3
(1) 𝑛 𝑘1 (1) 𝑛 𝑘2 (1) 𝑛 𝑘3
]
= [
𝑛𝑖1 𝑛𝑖2 𝑛𝑖3
𝑛𝑗1 𝑛𝑗2 𝑛𝑗3
𝑛 𝑘1 𝑛 𝑘2 𝑛 𝑘3
] = 𝑣.
Now that we have shown the set of 3x3 magic squares forms a vector space, we must show
that the set{ 𝐽, 𝐾, 𝐿} forms a basis for all 3x3 magic squares where:
𝐽 = [
1 1 1
1 1 1
1 1 1
], 𝐾 = [
0 1 −1
−1 0 1
1 −1 0
] , 𝐿 = [
−1 1 0
1 0 −1
0 −1 1
].
To show that { 𝐽, 𝐾, 𝐿} forms a basis for all 3x3 magic squares we must show that every 3x3
magic square can be expressed as a linear combination of { 𝐽, 𝐾, 𝐿}. So, for any arbitrary 3x3
magic square [
𝑥 𝑦 𝑧
𝑞 𝑟 𝑠
𝑡 𝑢 𝑣
] there exists Real number coefficients 𝑎, 𝑏, 𝑐, such that:
7. 7
[
𝑥 𝑦 𝑧
𝑞 𝑟 𝑠
𝑡 𝑢 𝑣
] = 𝑎 [
1 1 1
1 1 1
1 1 1
] + 𝑏 [
0 1 −1
−1 0 1
1 −1 0
] + 𝑐 [
−1 1 0
1 0 −1
0 −1 1
] =
[
𝑎 𝑎 𝑎
𝑎 𝑎 𝑎
𝑎 𝑎 𝑎
] + [
0 𝑏 −𝑏
−𝑏 0 𝑏
𝑏 −𝑏 0
] + [
−𝑐 𝑐 0
𝑐 0 −𝑐
0 −𝑐 𝑐
] = [
𝑎 − 𝑐 𝑎 + 𝑏 + 𝑐 𝑎 − 𝑏
𝑎 − 𝑏 + 𝑐 𝑎 𝑎 + 𝑏 − 𝑐
𝑎 + 𝑏 𝑎 − 𝑏 − 𝑐 𝑎 + 𝑐
]
Notice that all of the rows, columns, and diagonals have a sum of 3𝑎, this satisfies our definition
of a magic square and creates a general formula for constructing a 3x3 magic square.
So far, we have shown that the set of 3x3 magic squares forms a vector space, and that
{𝐽, 𝐾, 𝐿} forms a basis for the set of 3x3 magic squares. We will now show the following
properties:
a. 𝐽2
= 3𝐽
b. 𝐾2
= 𝐽 − 3𝐼
c. 𝐿2
= 3𝐼 − 𝐽
d. 𝐾𝐿 + 𝐿𝐾 = 0
e. 𝐾𝐽 = 𝐽𝐾 = 𝐽𝐿 = 𝐿𝐽 = 0
f. 𝐽𝐴 = 𝐴𝐽 = 3𝑎𝐽
Note that, by definition, the identity matrix and zero matrix are represented as follows
𝐼 = [
1 0 0
0 1 0
0 0 1
] , 0 = [
0 0 0
0 0 0
0 0 0
]
a. 𝐽2
= [
1 1 1
1 1 1
1 1 1
] ∙ [
1 1 1
1 1 1
1 1 1
] = [
3 3 3
3 3 3
3 3 3
] = 3 ∙ [
1 1 1
1 1 1
1 1 1
] = 3𝐽
9. 9
f. 𝐽𝐴 = [
1 1 1
1 1 1
1 1 1
] ∙ [
𝑎 − 𝑐 𝑎 + 𝑏 + 𝑐 𝑎 − 𝑏
𝑎 − 𝑏 + 𝑐 𝑎 𝑎 + 𝑏 − 𝑐
𝑎 + 𝑏 𝑎 − 𝑏 − 𝑐 𝑎 + 𝑐
] = [
3𝑎 3𝑎 3𝑎
3𝑎 𝑎𝑎 3𝑎
3𝑎 3𝑎 3𝑎
] = 𝐴𝐽 = 3𝑎𝐽
We have now obtained all of the pieces we need that leads us to the following theorem.
Theorem: If 𝐴 is a 3x3 magic square, then 𝐴3
is a magic square and 𝐴−1
(if it exists) is a magic
square.
Proof: Let 𝐴 = 𝑎𝐽 + 𝑏𝐾 + 𝑐𝐿 be an arbitrary 3x3 magic square. Then,
𝐴2
= ( 𝑎𝐽 + 𝑏𝐾 + 𝑐𝐿)2
= 𝑎2
𝐽2
+ 𝑎𝐽𝑏𝐾 + 𝑎𝐽𝑐𝐿 + 𝑏𝐾𝑎𝐽 + 𝑏2
𝐾2
+ 𝑏𝐾𝑐𝐿 + 𝑐𝐿𝑎𝐽 + 𝑐𝐿𝑏𝐾 + 𝑐2
𝐿2
= 𝑎2
𝐽2
+ 𝑏2
𝐾2
+ 𝑐2
𝐿2
+ 𝑎𝑏( 𝐽𝐾 + 𝐾𝐽) + 𝑎𝑐( 𝐽𝐿 + 𝐿𝐾) + 𝑏𝑐(𝐾𝐿 + 𝐿𝐾)
So, by our previously shown properties (a. - e.), we have
= 𝑎2
3𝐽 + 𝑏2( 𝐽 − 3𝐼) + 𝑐2
(3𝐼 − 𝐽)
= 𝑎2
3𝐽 + 𝑏2
𝐽 − 𝑏2
3𝐼 + 𝑐2
3𝐼 − 𝑐2
𝐽
= 3( 𝑐2
− 𝑏2) 𝐼 + (3𝑎2
+ 𝑏2
− 𝑐2) 𝐽
Now we must multiply both sides of the equation by 𝐴 to obtain 𝐴3
𝐴3
= (3( 𝑐2
− 𝑏2) 𝐼 + (3𝑎2
+ 𝑏2
− 𝑐2) 𝐽) 𝐴
= 3( 𝑐2
− 𝑏2) 𝐼𝐴 + (3𝑎2
+ 𝑏2
− 𝑐2 ) 𝐽𝐴
By (f.),
= 3( 𝑐2
− 𝑏2) 𝐴 + 3𝑎(3𝑎2
+ 𝑏2
− 𝑐2) 𝐽
10. 10
Since 𝐴 and 𝐽 are magic squares themselves, and because they are closed under scalar
multiplication and matrix addition, 𝐴3
is a magic square.
Referring back to our previous equation 𝐴2
= 3( 𝑐2
− 𝑏2 ) 𝐼 + (3𝑎2
+ 𝑏2
− 𝑐2) 𝐽 and
multiplying both sides by 3a, we obtain
3𝑎(𝐴2
) = 3𝑎(3( 𝑐2
− 𝑏2 ) 𝐼) + 3𝑎(3𝑎2
+ 𝑏2
− 𝑐2) 𝐽
3𝑎( 𝐴2) − 3𝑎(3𝑎2
+ 𝑏2
− 𝑐2) 𝐽 = (9𝑎( 𝑐2
− 𝑏2) 𝐼)
then we can rewrite 3𝑎𝐽 as 𝐽𝐴
3𝑎( 𝐴2) − (3𝑎2
+ 𝑏2
− 𝑐2 ) 𝐽𝐴 = (9𝑎( 𝑐2
− 𝑏2) 𝐼)
𝐴(3𝑎( 𝐴) − (3𝑎2
+ 𝑏2
− 𝑐2) 𝐽 = (9𝑎( 𝑐2
− 𝑏2) 𝐼)
notice that 𝐴−1
only exists if 𝑎 ≠ 0 and 𝑏 ≠ ± 𝑐. So, if 𝐴−1
exists, then it is represented by the
equation
𝐴−1
=
1
9𝑎( 𝑐2 − 𝑏2)
(3𝑎( 𝐴) − (3𝑎2
+ 𝑏2
− 𝑐2) 𝐽)
which is again a magic square because 𝐴 and 𝐽 are magic squares themselves, and magic squares
are closed under scalar multiplication and matrix addition.
To give an example following the form of our proven theorem, refer to the following 3x3
magic square, 𝑀
𝑀 = [
2 7 6
9 5 1
4 3 8
]
It is easily shown by matrix multiplication that
12. 12
Notice that 𝑀3
= 1125( 𝐽)− 24( 𝐾) + 72(𝐿) is magic because 𝐽, 𝐾, 𝐿 are 3x3 magic squares and
3x3 magic squares are closed under addition.
= 1125 [
1 1 1
1 1 1
1 1 1
] − 24[
0 1 −1
−1 0 1
1 −1 0
] + 72[
−1 1 0
1 0 −1
0 −1 1
]
= [
1053 1173 1149
1221 1125 1029
1101 1077 1197
] which corresponds with our above matrix for 𝑀3
.
Now, lets take a look at 𝑀−1
. It is easily checked that
𝑀−1
=
[
−
37
360
19
180
23
360
17
90
1
45
−
13
90
−
7
360
−
11
180
53
360 ]
And so the corresponding row/column/diagonals have a sum of
24
360
and 𝑀−1
satisfies our
definition, making it a magic square. Referring to our equation for the inverse of a magic square,
we have 𝑀−1
=
1
9𝑎( 𝑐2−𝑏2)
(3𝑎( 𝑀)− (3𝑎2
+ 𝑏2
− 𝑐2) 𝐽), and we know 𝑎 = 5, 𝑏 = −1, 𝑐 = 3.
We substitute these values into the equation and we yield
𝑀−1
=
1
9(5)(32 − (−1)2)
(3(5)( 𝑀)− (3(5)2
+ (−1)2
− 32) 𝐽)
=
1
360
(15( 𝑀) − (67) 𝐽)
=
1
360
(15 [
2 7 6
9 5 1
4 3 8
] − 67[
1 1 1
1 1 1
1 1 1
])
13. 13
=
1
360
[
−37 38 23
68 8 −52
−7 −22 53
]
=
[
−
37
360
19
180
23
360
17
90
1
45
−
13
90
−
7
360
−
11
180
53
360 ]
This corresponds with our original 𝑀−1
and therefore our methods used to prove the cube and
inverse are magic holds true.
Thus, it is proven that the cube of a magic square is in face a magic square, and the
inverse (if it exists) is also a magic square. With that said, notice that the ninth power of a 3x3
magic square will be magic, since the cubed power is magic and we simply cube the cubed
power, and therefore any repetition of cubes of a 3x3 magic square will remain a magic square.
These facts do not hold for all nxn magic squares, but they do hold true for 3x3 magic squares
that have matrix entries.