#### Abstract

The definition of a regular magic square motivates us to introduce the new special magic squares, which are reflective magic squares, corner magic squares, and skew-regular magic squares. Combining the concepts of magic squares and linear algebra, we consider a magic square as a matrix and find the dimensions of the vector spaces of these magic squares under the standard addition and scalar multiplication of matrices by using the rank-nullity theorem.

#### 1. Introduction

A classical magic square is an square array of the distinct positive integers arranged in such a way that the summations of entries along each row, each column, the main diagonal, and the cross diagonal are all equal to the same constant, called a* magic sum*. For example, the famous classical magic square appearing in Albrecht Dürer’s engraving* Melancholia*, known as Yang Hui-Dürer magic square, is

In this article, a magic square is also defined in the same context as the classical one except that all of its entries can be any real numbers and need not be distinct. The idea to study a magic square as a matrix was initiated by Fox [1] in 1956 where he considered a magic square as a matrix of real numbers (each entry needs not to be distinct) and showed that the inverse of a magic square with the magic sum was also a magic square with the magic sum . Certainly, many research studies of magic squares in the framework of linear algebra come afterwards.

The set of all magic squares is well-known to be a vector space over under the usual addition and scalar multiplication of matrices, denoted by MS(). A magic square with the zero magic sum is called a* zero magic square*, and 0MS() denotes the set of all zero magic squares, which is a subspace of MS(). In 1959, Ratliff [2] found the dimension of the vector space of all magic squares whose entries are from any field . Later in 1980, Ward [3] by applying the rank and nullity theorem derived that the dimension of the vector space of all magic squares over was equal to .

One of the popular types of the special magic squares that draw attentions from researchers is the regular magic squares; for example, see [4–9]. The property to define a regular magic square was noticed during the construction of magic squares (see [10] p. 202). We then challenge ourselves by constructing new types of magic squares which leads us to determine the following three types of magic squares.

#### 2. Reflective Magic Squares

Before introducing the reflective magic squares, we shall recall the definition of the regular magic squares.

*Definition 1. *An magic square with a magic sum is said to be* regular* ifThe set of all regular magic squares is denoted by RMS() and 0RMS() is the set of all zero regular magic squares. The magic squares below are examples of and regular magic squares where the entries with the same symbol represent the pairs satisfying (2):

In the regular conditions, any two entries added together are located in the positions diametrically equidistant from the center of the square. This way of symmetry persuades us to add up a new pair of entries that are symmetric along the main diagonal line. In this fashion, we define the new magic squares.

*Definition 2. *An magic square with a magic sum is said to be* reflective* if

Nonetheless, condition (5) imposed here with the summation conditions of a magic square forces all entries on the main diagonal to be . In particular, all entries on the main diagonal of a zero magic square must be zero. Let FMS() and 0FMS() denote the set of all reflective magic squares and zero reflective magic squares, respectively. Consequently, FMS() and 0FMS() are subspaces of MS().

Lee et al. [11] showed that the dimension of the vector space of all regular magic square matrices (RMS()) is when is odd and when is even. Their results lead us to pursue the dimension of FMS(). We shall begin with the most basic approach.

Let such thatThen we derive the homogeneous system of linear equations of s’ satisfying the row conditions, column conditions, and the reflective conditions, respectively. The main condition is omitted in this case because each entry on the main diagonal is zero. Moreover, the cross diagonal condition is replaced by the reflective conditions. Let denote the coefficient matrix where the variables are , as shown in the following example of the coefficient matrix when :By using elementary row operations to to get the row-reduced echelon matrix of , we derive a basis of 0FMS to be Moreover, the associate basis for FMS is , whereTherefore, = 3 and = 4. Elements in 0FMS and FMS can be calculated by using these bases; for example,

However, this basic method cannot be used to find the dimension of and in the general cases. The rank and nullity theorem plays an important role to obtain the results.

Theorem 3. *For , the dimension of is and the dimension of is .*

*Proof. *Let , where and , for all . By the summation of s’ along each line to be zero, we then write the homogeneous system of linear equations of s’ satisfying the row conditions, column conditions, and the reflective conditions, respectively. The cross diagonal condition is not included here because it is replaced by the reflective conditions. We denote , the th row of the coefficient matrix, and let denote the coefficient matrix where the variables are all such that for all . That is, there are variables in the homogeneous system. By the rank-nullity theorem, can be derived by finding the rank of the coefficient matrix first. In this case, is an matrix (see equation (7)) whose rows are ordered by row conditions (starting from the first row), column conditions (starting from the first column), and reflective conditions (ordering pairs from left to right and then to the rows below). The rows of are related in the following ways:(1) is a linear combination of for all (2) is a linear combination of , and for all .(3)For each , is a linear combination of , and rows from the reflective conditions.(4) is a linear combination of for all and rows from the reflective conditions.(5) is a linear combination of , , and rows from the reflective conditions.(6) is a linear combination of for all and rows from the reflective conditions.(7)The remaining rows, which are all rows except where , are linearly independent. Therefore, . Let denote the matrix with all entries of 1. We observe that, for any with a magic sum , there is the associate zero magic square , where . It is easy to see that forms a basis for FMS() for any basis of 0FMS(). Hence .

The generalization of a regular magic square which we shall introduce next will be a magic square satisfying a condition of combining four entries instead of adding two entries.

#### 3. Corner Magic Squares

The idea to construct this type of magic squares comes from our observation on any four entries in a magic square which form corners of a rectangle whose center is the same as the magic square and is symmetric horizontally and vertically. In particular, even the famous Yang Hui-Dürer magic square also satisfies the observed properties.

*Definition 4. *An magic square with a magic sum is said to be a* corner magic square* if for all The set of all corner magic squares is denoted by CMS() and 0CMS() is the set of all zero regular magic squares. The magic squares below are examples of and corner magic squares where the entries with the same symbol represent the entries satisfying (11):

By the linear property of (11), it is easy to check that both 0CMS() and CMS() are subspaces of MS(). Moreover, and , but the converse does not hold; for example,is an element in CMS(), but not in RMS(). Nevertheless, CMS() = RMS() and 0CMS() = 0RMS().

To find a basis of 0CMS(), we can use the Gauss-Jordan elimination method as before to retrieve a basis of 0CMS() to be , whereMoreover, the associate basis of CMS() is , wherethat is, = 7 and = 8. Apparently, = . This means that CMS is the same space as MS(). Furthermore, we can use the bases to find a magic square in 0MS() and MS(); for example,

Nevertheless, CMS is not always the same set as MS. For the general case, we can apply the rank and nullity theorem to find the dimension of 0CMS and CMS.

Theorem 5. *For , the dimension of 0CMS is when is odd and when is even. Moreover, the dimension of CMS is when is odd and when is even.*

*Proof. *Let 0CMS(), where for all . By the summation of s’ along each line to be zero, we then write the homogeneous system of linear equations of s’ satisfying the row conditions, column conditions, the main diagonal condition, the cross diagonal condition, and the corner conditions, respectively. As before, let denote the coefficient matrix.*Case 1* ( is odd). Including all conditions, there are homogeneous equations in the system and by the corner condition at the center. Then all except are variables in this system. We then arrange the equations so that the coefficient matrix is an matrix of 0’s and 1’s where its rows are, respectively, ordered by row conditions, column conditions, main diagonal condition, cross diagonal condition, and corner conditions. See the following matrix as an example of the coefficient matrix when :Observing the coefficient matrix , we derive the relationships of the rows of as follows: (1) is a linear combination of for all (2) is a linear combination of and for all .(3)The remaining rows are linearly independent. Therefore, has linearly independent rows. By the rank-nullity theorem, .*Case 2* ( is even). In this case, the coefficient matrix is an matrix of 0’s and 1’s such that its rows are, respectively, arranged by row conditions, column conditions, main diagonal condition, cross diagonal condition, and corner conditions (see (17) for example). Moreover, we derive the relationships of the rows of as follows: (1) is a linear combination of for all (2) is a linear combination of and for all .(3)The remaining rows are linearly independent.Therefore, has linearly independent rows. By the rank-nullity theorem, .

Let be the matrix with all entries of 1. For any with a magic sum , we have the associate zero magic square such that . From this fact, forms a basis for CMS() when is a basis for 0CMS(). The dimension of CMS is then derived to be .

#### 4. Skew-Regular Magic Squares

From the corner magic squares, we shift to observe any four entries in a magic square which form corners of a rectangle located in the position that its center is the same as the magic square and symmetrical axes are the main diagonal and cross diagonal.

*Definition 6. *An magic square with a magic sum is said to be a* skew-regular magic square* if where and if is odd and and if is even. The set of all skew-regular magic squares is denoted by SRMS() and 0SRMS() is the set of all zero skew-regular magic squares. The matrices below are examples to indicate groups of four entries (not on the diagonals) in the same symbols satisfying (18) for skew-regular magic squares:

As before, the linear property of (18) implies that both 0SRMS() and SRMS() are subspaces of MS().

Theorem 7. *For ,*

*Proof. *Let , where for all .*Case 1* ( is odd). All rows of the coefficient matrix are ordered by row conditions, column conditions, the main diagonal condition, the cross diagonal condition, and skew-regular conditions, respectively. Including all conditions, there are homogeneous equations in the system. By the sums along the middle column, the middle row, and all four corners on these two lines, we can conclude that . Then we have the homogeneous system with the variables all except Observing the coefficient matrix , we derive the relationships of the rows of as follows: (1) is a linear combination of for all (2) is a linear combination of , and all rows from the skew-regular conditions except for all .(3) is a linear combination of and for all .(4)The remaining rows are linearly independent. By the rank and nullity theorem, .*Case 2* ( is even). The rows of are arranged as in the previous case except that there are skew-regular conditions; see the following matrix as an example of the coefficient matrix when :and hence, has rows and columns. Moreover, we derive the relationships of the rows of as follows: (1) is a linear combination of for all (2) is a linear combination of and .(3)The remaining rows are linearly independent. Therefore, has linearly independent rows resulting in .

From the same reason as before, is a basis for SRMS() for any basis of 0SRMS() where is the matrix with all entries of 1. Hence is derived afterward.

#### 5. Conclusion

According to the studies of regular magic squares, the reflective magic squares, corner magic squares, and skew-regular magic squares, as the generalization, can also lead to new research studies of their properties and applications.

#### Competing Interests

The authors declare that there is no conflict of interests regarding the publication of this paper.