1. Introduction

A semi-magic square is an n � n matrix such that the sum of the entries in each row and column is the same. The common value is called the magic constant. If, in addition, the sum of all entries in each left-broken diagonal and each right-broken diagonal is the magic constant, then we call the matrix a pandiagonal magic square. Rosser and Walker show that a pandiagonal 4 � 4 magic square with magic constant 2s has in general the following structure.


where

$$
\omega = \mathbf{2s} - \mathbf{A} - \mathbf{B} - \mathbf{C};
$$

$$
\theta = \mathbf{2s} - \mathbf{A} - \mathbf{B} - \mathbf{E};
$$

© 2016 The Author(s). Licensee InTech. This chapter is distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/3.0), which permits unrestricted use, distribution, and eproduction in any medium, provided the original work is properly cited. © 2018 The Author(s). Licensee IntechOpen. This chapter is distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/3.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

$$
\boldsymbol{\zeta} = \mathbf{A} + \mathbf{E} - \mathbf{C};
$$

$$
\boldsymbol{\rho} = \mathbf{B} + \mathbf{C} - \mathbf{E}.
$$

Using Maple we can show that the 6 � 6 panmagic square possesses a nontrivial null space,

Nullspace of Compound Magic Squares http://dx.doi.org/10.5772/intechopen.74678 61

z xð Þ <sup>1</sup>; <sup>x</sup>2; <sup>x</sup>3; �x1; �x2; �x<sup>3</sup> <sup>0</sup> : <sup>z</sup><sup>∈</sup> <sup>R</sup>

x<sup>2</sup> ¼ ð Þ F � I ðB þ 2C þ E � 3sÞ þ 2FD � 2AI þ ð Þ D � A ð Þ G þ J þ 2H � 3s ,

�51 39 26 0 9 13 �10 �2 �5 4 �5 �5 1 2 3 17 18 3 �1 63 �27 �14 8 17 �42 22 14 �5 �6 17 11 10

Definition 2: A 8 � 8 square consisting of 4 pandiagonal magic squares A11, A12, A21, A<sup>22</sup> hav-

A<sup>11</sup> A<sup>12</sup> <sup>A</sup><sup>21</sup> <sup>A</sup><sup>22</sup>

A<sup>22</sup> þ A<sup>11</sup> ¼ A<sup>12</sup> þ A21:

It is easy to check if the last relation guarantees that the square is a magic 8 � 8 square. In the

Definition 3: Let B22, B11, B12, B<sup>21</sup> be panmagic squares having the same magic constant.

B<sup>11</sup> B<sup>12</sup> <sup>B</sup><sup>21</sup> <sup>B</sup><sup>22</sup>

The condition B<sup>22</sup> þ B<sup>11</sup> ¼ B<sup>12</sup> þ B<sup>21</sup> ensures that the compound 12 � 12 magic square is magic.

x<sup>3</sup> ¼ ð Þ B � E ð Þþ F þ I þ 2H ð Þ A þ D þ 2C þ 2B þ 2E � 3s ð Þ J � G :

which can be written in the following form:

x<sup>1</sup> ¼ ð Þ A � D ð Þ G � J ð Þ B � E ð Þ I � F ,

Note that the sum of all entries of the vectors is zero. For example:

has as nullspace <sup>z</sup>ð Þ <sup>34</sup>; <sup>115</sup>; �132; �34; �115; <sup>132</sup> <sup>t</sup> : <sup>z</sup><sup>∈</sup> <sup>R</sup> .

is called a compound magic square if the following relation holds:

Assume that B<sup>22</sup> þ B<sup>11</sup> ¼ B<sup>12</sup> þ B21. Then the matrix

is called the compound 12 � 12 magic square.

same manner we can combine four panmagic squares in a magic square.

ing the same magic sum in the form

where

This result was developed by Rosser and Walker. Hendricks proved that the determinant of a pandiagonal magic square is zero. We note that every antipodal pair of elements add up to one-half of the magic constant. Al-Amerie considered in his M.Sc thesis some of the results here. There are three fundamental primitive pandiagonal squares which are 4 � 4. Kraitchik (see [3, 8]) has shown how to derive all pandiagonal squares from three particular ones.

We define a certain class of 6 � 6 magic squares, which has a similar structure to the structure of a pandiagonal 4 � 4 magic square. In this class each antipodal pair will add up to one-third of the magic constant. Precisely, we have:

Definition 1: A 6 � 6 magic square with 3s as a magic constant is called panmagic if

aij þ akl ¼ s, for each i, j, k, l such that i � k ð Þ mod 3 and j � l ð Þ mod 3 :

The following matrix is a possible form for this kind of squares:


where

$$M = f + I + H + E + D + C - L - K - \frac{3s}{2},$$

$$W = K - I + F - D + A,$$

$$P = 3s - E - D - C - B - A$$

$$Q = 3s - f - I - H - G - F,$$

$$R = L - f + G - E + B,$$

$$T = \frac{9s}{2} - L - K - H - G - F - C - B - A.$$

Note that we have the following relations:

$$\begin{aligned} M + Q + P &= T + H + C, \\ R + J + E &= L + G + B, \\ W + I + D &= K + F + A. \end{aligned} \tag{1}$$

Using Maple we can show that the 6 � 6 panmagic square possesses a nontrivial null space, which can be written in the following form:

$$\{z(\mathbf{x}\_1, \mathbf{x}\_2, \mathbf{x}\_3, -\mathbf{x}\_1, -\mathbf{x}\_2, -\mathbf{x}\_3)' : z \in R\}$$

where

ς ¼ A þ E � C;

r ¼ B þ C � E:

This result was developed by Rosser and Walker. Hendricks proved that the determinant of a pandiagonal magic square is zero. We note that every antipodal pair of elements add up to one-half of the magic constant. Al-Amerie considered in his M.Sc thesis some of the results here. There are three fundamental primitive pandiagonal squares which are 4 � 4. Kraitchik (see [3, 8]) has shown how to derive all pandiagonal squares from three particular ones.

We define a certain class of 6 � 6 magic squares, which has a similar structure to the structure of a pandiagonal 4 � 4 magic square. In this class each antipodal pair will add up to one-third

aij þ akl ¼ s, for each i, j, k, l such that i � k ð Þ mod 3 and j � l ð Þ mod 3 :

MR WT L K Q J I H GF P E DC BA s � T s � L s � K s � M s � R s � W s � H s � G s � F s � Q s � J s � I s � C s � B s � A s � P s � E s � D

<sup>M</sup> <sup>¼</sup> <sup>J</sup> <sup>þ</sup> <sup>I</sup> <sup>þ</sup> <sup>H</sup> <sup>þ</sup> <sup>E</sup> <sup>þ</sup> <sup>D</sup> <sup>þ</sup> <sup>C</sup> � <sup>L</sup> � <sup>K</sup> � <sup>3</sup><sup>s</sup>

W ¼ K � I þ F � D þ A,

P ¼ 3s � E � D � C � B � A

Q ¼ 3s � J � I � H � G � F,

R ¼ L � J þ G � E þ B,

M þ Q þ P ¼ T þ H þ C, R þ J þ E ¼ L þ G þ B, W þ I þ D ¼ K þ F þ A:

<sup>2</sup> � <sup>L</sup> � <sup>K</sup> � <sup>H</sup> � <sup>G</sup> � <sup>F</sup> � <sup>C</sup> � <sup>B</sup> � <sup>A</sup>:

2 ,

(1)

Definition 1: A 6 � 6 magic square with 3s as a magic constant is called panmagic if

The following matrix is a possible form for this kind of squares:

<sup>T</sup> <sup>¼</sup> <sup>9</sup><sup>s</sup>

Note that we have the following relations:

of the magic constant. Precisely, we have:

60 Matrix Theory-Applications and Theorems

where

$$\begin{aligned} \mathbf{x}\_1 &= (A - D)(\mathbf{G} - I)(B - E)(I - F), \\ \mathbf{x}\_2 &= (F - I)(B + 2\mathbf{C} + E - 3\mathbf{s}) + 2FD - 2AI + (D - A)(\mathbf{G} + I + 2H - 3\mathbf{s}), \\ \mathbf{x}\_3 &= (B - E)(F + I + 2H) + (A + D + 2\mathbf{C} + 2B + 2E - 3\mathbf{s})(I - G). \end{aligned}$$

Note that the sum of all entries of the vectors is zero. For example:


has as nullspace <sup>z</sup>ð Þ <sup>34</sup>; <sup>115</sup>; �132; �34; �115; <sup>132</sup> <sup>t</sup> : <sup>z</sup><sup>∈</sup> <sup>R</sup> .

Definition 2: A 8 � 8 square consisting of 4 pandiagonal magic squares A11, A12, A21, A<sup>22</sup> having the same magic sum in the form

$$
\begin{bmatrix} A\_{11} & A\_{12} \\ A\_{21} & A\_{22} \end{bmatrix}
$$

is called a compound magic square if the following relation holds:

$$A\_{22} + A\_{11} = A\_{12} + A\_{21}.$$

It is easy to check if the last relation guarantees that the square is a magic 8 � 8 square. In the same manner we can combine four panmagic squares in a magic square.

Definition 3: Let B22, B11, B12, B<sup>21</sup> be panmagic squares having the same magic constant. Assume that B<sup>22</sup> þ B<sup>11</sup> ¼ B<sup>12</sup> þ B21. Then the matrix

$$
\begin{bmatrix} B\_{11} & B\_{12} \\ B\_{21} & B\_{22} \end{bmatrix}
$$

is called the compound 12 � 12 magic square.

The condition B<sup>22</sup> þ B<sup>11</sup> ¼ B<sup>12</sup> þ B<sup>21</sup> ensures that the compound 12 � 12 magic square is magic.
