aa r X i v : . [ m a t h . G M ] S e p Commuting Magic Square Matrices
Ronald P. Nordgren Brown School of Engineering, Rice University
Abstract.
We review a known method of compounding two magic square matrices of order m and n with the all-ones matrix to form two magic square matrices of order mn. We show that these com-pounded matrices commute. Simple formulas are derived for their Jordan form and singular valuedecomposition. We verify that regular (associative) and pandiagonal commuting magic squares canbe constructed by compounding. In a special case the compounded matrices are similar. General-ization of compounding to a wider class of commuting magic squares is considered. Three numericalexamples illustrate our theoretical results.
The construction of magic squares by compounding smaller ones arose over 1000 years ago and hasattracted interest ever since as reviewed by Pickover [11], Chan and Loly [1], and Rogers, et. al[13]. In the present article we begin with a formulation of the compounding construction given byEggermont [2] and extended in [13]. Two basic magic square matrices of order m and n ( m, n ≥ mn that are shown to commute. These two matrices arecombined to form two natural magic square matrices of order mn that commute. When m = n andthe two basic magic squares are identical, we verify a result in [13] that the two compounded magicsquare matrices are related by a row/column permutation (shuffle) that we express in matrix formwhich shows that they are similar matrices. We verify a known result [2] that regular (associative)and pandiagonal special properties are preserved by compounding. Simple formulas are derived forthe matrices in the Jordan form and singular value decomposition of the compounded matrices interms of those of the basic matrices . Generalization to a wider class of commuting magic squaresis considered but our formulas for the Jordan form and SVD do not apply to them. Examples aregiven of commuting magic square matrices of orders 9, 12, and 16, all with special properties. Magic Squares.
To begin, let E n denote the order- n square matrix with all elements one and let R n denote the order- n square matrix with ones on the cross diagonal and all other elements zero.Let M n be an order- n magic square matrix whose rows, columns and two main diagonals add tothe summation index µ n , i.e. M n E n = E n M n = µ n E n , tr [ M n ] = tr [ R n M n ] = µ n . (1)We further require that M n be a natural magic square with elements 0 , , . . . , n −
1, whence µ n = n n − . (2)From two magic squares M m and M n , two order- mn matrices can be formed by compounding asfollows [2, 13]: A mn = E m ⊗ M n , B mn = M m ⊗ E n , (3) email: [email protected] ⊗ ” denotes the tensor (Kronecker) product [3, 6]. On noting that E m ⊗ E n = E n ⊗ E m = E mn , E n = n E n , tr [ E n ] = n, R m ⊗ R n = R n ⊗ R m = R mn , R n = I n , R n E n = E n R n = E n , (4)and using formulas for the tensor product [6], from (1), (3), and (4), we find that E mn A mn = ( E m ⊗ E n ) ( E m ⊗ M n ) = E m ⊗ ( E n M n ) = m E m ⊗ ( µ n E n ) = mµ n E mn , tr [ A mn ] = tr [ E m ⊗ M n ] = tr [ E m ] tr [ M n ] = mµ n , (5)tr [ R mn A mn ] = tr [( R m ⊗ R n ) ( E m ⊗ M n )] = tr [( R m E m ) ⊗ ( R n M n )] = mµ n , and similarly for B mn . Thus, A mn and B mn are unnatural magic squares with summation indices mµ n and nµ m , respectively. Furthermore, we find that A mn and B mn commute since A mn B mn = ( E m ⊗ M n ) ( M m ⊗ E n ) = ( E m M m ) ⊗ ( M n E n ) = µ m µ n E mn , B mn A mn = ( M m ⊗ E n ) ( E m ⊗ M n ) = ( M m E m ) ⊗ ( E n M n ) = µ m µ n E mn . (6)In addition, it can be shown that each of the eight phases [4, 7] of A mn commutes with the corre-sponding phase of B mn . We note that A mn and B mn are an orthogonal pair since the n by n subsquares of A mn contain m replicas of M n , whereas the elements of the n by n subsquares of B mn all are the same numberas that of the corresponding element of M m (as seen in the examples below). Thus, all combinationsof two numbers from A mn and B mn occur once and only once, i.e. A mn and B mn are orthogonal.Therefore, we can form two natural magic squares by the Euler composition formula [10] as follows: M Amn = A mn + n B mn , M Bmn = B mn + m A mn (7)which can be verified to satisfy the magic square conditions (1), e.g. E mn M Amn = E mn A mn + n E mn B mn = (cid:0) mµ n + n µ m (cid:1) E mn = 12 mn (cid:0) m n − (cid:1) E mn = µ mn E mn , (8)tr M Amn = tr A mn + n tr B mn = mµ n + n µ m = µ mn . We note that M ( A ) mn and M ( B ) mn commute since, by (7) and (6) M Amn M Bmn = (cid:0) A mn + n B mn (cid:1) (cid:0) B mn + m A mn (cid:1) = A mn B mn + m A mn A mn + n B mn B mn + m n B mn A mn , M Bmn M Amn = (cid:0) B mn + m A mn (cid:1) (cid:0) A mn + n B mn (cid:1) (9)= B mn A mn + n B mn B mn + m A mn A mn + m n A mn B mn , M Amn M Bmn = M Bmn M Amn . The foregoing compounding construction can be repeated using M Amn or M Bmn in (3) to pro-duce higher order magic squares which again commute. Gigantic commuting magic squares can beproduced by repeated compounding as done by Chan and Loly [1].
Regular Magic Squares.
In a regular (associative) matrix any two elements that are symmetricabout the center element add to the same number and in an odd-order regular matrix the centerelement is one-half this number. The regularity condition on M n can be expressed as M n + R n M n R n = 2 µ n n E n = (cid:0) n − (cid:1) E n , (10) Pasles [10] suggests that Benjamin Franklin used this formula prior to Euler. µ n /n can be verified by taking the trace of this equation. We wish to show thatif M m and M n are regular, then so are A mn , B mn , M Amn , and M Bmn as noted by Eggermont [2] for M Amn . From (4), (3), and (10), we find that R mn A mn R mn + A mn = ( R m ⊗ R n ) ( E m ⊗ M n ) ( R m ⊗ R n ) + A mn = ( R m E m R m ) ⊗ ( R n M n R n ) + A mn = E m ⊗ (cid:0)(cid:0) n − (cid:1) E n − M n (cid:1) + E m ⊗ M n (11)= (cid:0) n − (cid:1) E mn and similarly R mn B mn R mn + B mn = (cid:0) m − (cid:1) E mn (12)which are the regularity conditions for A mn and B mn . From their definitions (7), M Amn and M Bmn are regular when A mn and B mn are regular as seen from M Amn + R mn M Amn R mn = (cid:0) A mn + n B mn (cid:1) + R mn (cid:0) A mn + n B mn (cid:1) R mn = A mn + n B mn + (cid:0) n − (cid:1) E mn − A mn + n (cid:0) m − (cid:1) E mn − n B mn = (cid:0) m n − (cid:1) E mn (13)and similarly for M Bmn .In addition, for a regular magic square M (1) n and its 180 ◦ rotation M (2) n , given by M (2) n = R n M (1) n R n , (14)it follows from (10) that M (1) n and M (2) n commute and similarly for M (1) m and M (2) m . These twocommuting duos can be used in equations of the form (3) and (7) to form a quartet of mutuallycommuting regular magic squares. Repeated compounding of these squares leads in an immensenumber of commuting regular magic squares of increasing order. A class of pandiagonal squaresgiven in [7] also can be used to form commuting duos. Pandiagonal Magic Squares.
In a pandiagonal magic square of order n, all 2 n diagonals, includingbroken ones in both directions, sum to µ n . It is known that a regular magic square M Rn of doubly-even order ( n = 4 k, k = 1 , , . . . ) can be transformed to a pandiagonal magic square M P n by thePlanck transformation [12, 7]. Thus, if M m and M n are regular and mn is doubly-even, then M Amn and M Bmn are regular (as shown above) and doubly-even order. Therefore, they can be transformedto pandiagonal magic squares which can be shown to commute.It also is possible to compound commuting pandiagonal magic squares M Amn and M Bmn directlyfrom (3) and (7) starting with pandiagonal magic squares M m and M n as noted by Eggermont [2]and carried out by Chan and Loly [1] for M A . The pandiagonality of the compounded matrix isestablished by them and is verified in an example below for M A and M B . Magic squares that areboth regular and pandiagonal are called ultra-magic squares, with 5 being the lowest order for theirexistence, leading to order-25 commuting ultra-magic squares by the compounding construction. Special Case - Permutation . Simplification is possible by taking M m = M n ( m = n ) in (3). Inthis case, as noted by Rogers, et. al [13], interchange (shuffling) of rows and columns of A nn leadsto B nn and vice versa. We find that this interchange can be expressed as B nn = P nn A nn P nn , A nn = P nn B nn P nn , (15)where P nn is a symmetric permutation matrix that can be written in block form as P nn = p p · · · p n p p · · · p n ... ... . . . ... p n p n · · · p nn (16)3n which p ij are order- n matrices with element p ij ( j, i ) = 1 and all other elements zero. It can beshown that R nn P nn R nn = P nn , P Tnn = P − nn = P nn . (17)Thus,(15) is a similarity transformation [6] and A nn and B nn are similar matrices . The formulas(15), (16) and (17) will be verified in the examples below. From (15) and (7), M Ann and M Bnn alsoare similar and are related by the permutations M Bnn = P nn M Ann P nn , M Ann = P nn M Bnn P nn . (18) Extension . A huge number of pairs of commuting magic squares can be constructed using various M n ’s as the m subsquares of generalized ˜A mn and any M m as the basis for B mn in (3). Again, ˜A mn and B mn are an orthogonal pair and they commute since it can be shown that they satisfy(6). Thus, commuting ˜M Amn and ˜M Bmn can be formed from them using (7). However, since such an ˜A mn is not of the form (3), the general formulas for its Jordan form and SVD and those of ˜M Amn and ˜M Bmn (to be found next) do not apply.
We derive formulas for the Jordan-form matrices of A mn , B mn , M Amn , and M Bmn from those of E m , E n , M m , and M n . To review from [3, 6], the Jordan form of a square matrix M is given by M = SJS − , MS = SJ , (19)where S is a matrix whose columns are the simple or generalized eigenvectors s i of M and J is thematrix with zero elements except for eigenvalues λ i on the main diagonal and ones on the diagonalabove it corresponding to generalized eigenvectors. For a generalized eigenvector s ( i ) k with eigenvalue λ i of algebraic multiplicity k, (19) leads to( M − λ i I ) k s ( i ) k = ( M − λ i I ) k − s ( i ) k − = . . . = ( M − λ i I ) s ( i )1 = . (20)For a simple eigenvector s i with eigenvalue λ i of algebraic multiplicity 1 , (19) gives( M − λ i I ) s i = . (21)If all the eigenvectors of M are simple, then J ≡ D is diagonal.The Jordan form of magic square matrices is studied extensively in [4, 5, 7, 8, 13]. When M n isa magic square matrix, according to (1), it has an all-ones eigenvector s with eigenvalue λ = µ n . On applying E n to (20), we find that( µ n − λ i ) k E n s ( i ) k = ( µ n − λ i ) k − E n s ( i ) k − = . . . = ( µ n − λ i ) E n s ( i )1 = . (22)Since it is known [5] that | λ i | < µ n ( i ≥ E n s = nµ n s , E n s i = , i = 2 , , . . . . (23)The eigenvalues of E n are n, , , . . . , E n , using the S n matrixof M n , we have E n S n = S n D En E n [ s , s , . . . , s n ] = [ s , s , . . . , s n ] diag [ n, , , . . . ,
0] (24)[ n s , , . . . ,
0] = [ n s , , . . . , S n is the eigenvector matrix for both M n and E n and their Jordan formsread M n = S n J Mn S − n , E n = S n D En S − n . (25)Since E n is symmetric, it also has an orthogonal eigenvector matrix which is not used here. Whenall the eigenvectors of M n are simple, its eigenvalue matrix can be written as J Mn = diag ( µ n , λ n , λ n , . . . , λ nn ) (26)and for generalized eigenvectors of M n there are ones on the diagonal above the main diagonal fortheir corresponding eigenvalues in J Mn . Equations of the same form as the foregoing ones apply to M m and E m . Using a compounding technique given by Nordgren [8], from (25) and (3), we find that A mn = E m ⊗ M n = (cid:0) S m D Em S − m (cid:1) ⊗ (cid:0) S n J Mn S − n (cid:1) = ( S m ⊗ S n ) ( D Em ⊗ J Mn ) ( S m ⊗ S n ) − = S mn J Amn S − mn , B mn = M m ⊗ E n = (cid:0) S m J Mm S − m (cid:1) ⊗ (cid:0) S n D En S − n (cid:1) (27)= ( S nm ⊗ S n ) ( J Mm ⊗ D En ) ( S m ⊗ S n ) − = S mn J Bmn S − mn , where S mn = S m ⊗ S n , J Amn = D Em ⊗ J Mn , J Bmn = J Mm ⊗ D En . (28)Then, with (26), it follows that the nonzero eigenvalues of A mn and B mn are J Amn : nµ m , nλ m , nλ m , . . . , nλ mn , J Bmn : mµ n , mλ n , mλ n , . . . , mλ mn . (29)When M m and/or M n have generalized eigenvectors, J Amn and J Bmn from (28) are not in standardform but they can be brought there by modifying S mn as indicated in the example below for mn = 12.Furthermore, (7) with (27) gives the Jordan form of M Amn and M Bmn as M Amn = S mn J AMmn S − mn , M Bmn = S mn J BMmn S − mn , (30)where J AMmn = J Amn + n J Bmn , J BMmn = J Bmn + m J Amn , (31)and their eigenvalues can be expressed using (29). Special Case . In the special case where M m = M n ( m = n ) , according to (28), A nn and B nn have the same nonzero eigenvalues from (29), namely nµ n , nλ , nλ , . . . , nλ n , (32)but they appear in a different order in J Ann and J Bnn . To see this, by (15), (28), and (27), we form A nn = ( P nn S nn P nn ) (cid:0) P nn J Bnn P nn (cid:1) ( P nn S nn P nn ) − = S nn J Ann S − nn , (33)and similarly for B nn , whence P nn S nn P nn = S nn , J Ann = P nn J Bnn P nn , J Bnn = P nn J Ann P nn (34)which confirms that J Ann and J Bnn contain the same eigenvalues and indicates their reordering. Fur-thermore, M Ann and M Bnn also have the same nonzero eigenvalues, namely n (cid:0) n (cid:1) µ n , nλ , nλ , . . . , nλ n , n λ , n λ , . . . , n λ n (35)and equations of the form (34) apply to J AMnn and J BMnn . Rogers, et. al [13] derive similar formulas for eigenvalues and eigenvectors in a somewhat different manner. Singular Value Decomposition
We derive formulas for the matrices in the singular value decomposition (SVD) of A mn , B mn , M Amn ,and M Bmn in terms of those of E m , E n , M m , and M n . To review [3, 6], the SVD of any real squarematrix M is expressed as M = UΣV T , (36)where U and V are orthogonal matrices, and Σ is a diagonal matrix with non-negative real numbers(the singular values) on the diagonal. It follows from (36) that MM T = UΣ U T , M T M = VΣ V T (37)which are Jordan forms of the symmetric, positive semi-definite matrices MM T and M T M . Inparticular, the Jordan form of MM T can be used to determine U and Σ after which V can bedetermined from (36). If Σ is nonsingular, then (36) leads to V = M T UΣ − . (38)If Σ is singular, then an alternate approach given by Meyer [6] applies.The SVD of magic square matrices is studied in [4, 8, 13]. When M n is a magic square matrix,the U n and V n matrices for M n also apply to E n as we show next. In view of (1), M n and M Tn have an eigenvalue µ n with eigenvector s composed of constant elements c , therefore M n s = M Tn s = µ n s , M n M Tn s = µ n s , (39) s = c e n , E n s = nc e n , where e n is the order- n (column) vector with all elements one. From (37) and (39), we see that s also is an eigenvector in U n for the singular value µ . Since U n is orthogonal, u = s must be aunit vector, hence u T u = c e Tn e n = c n = 1 , ∴ u = √ nn e n , E n u = √ n e n . (40)The remaining eigenvectors in U n namely u , u , . . . , u n for singular values σ , σ , . . . , σ n in Σ Mn , according to (37), must satisfy (cid:0) M n M Tn − σ i I n (cid:1) u i = 0 , i = 2 , , . . . , n. (41)Application of E n to this equation results in (cid:0) µ − σ i (cid:1) E n u i = 0 , i = 2 , , . . . , n (42)and, since it is known [5] that σ i < µ ( i ≥ E n u i = , i = 2 , , . . . , n. (43)A similar argument holds for the singular vectors v i of V n and we may write (in block form) U n = h √ nn e n u . . . u n i , V n = h √ nn e n v . . . v n i , E n U n = E n V n = (cid:2) √ n e n . . . (cid:3) , (44) The SVD also applies to complex matrices and rectangular matrices which are not considered here. v , v , . . . v n remain to be determined from (36) as already noted. From the SVD for E n with U n and V n from (44), we have Σ En = U Tn E n V n = √ nn e Tn u T ... u Tn (cid:2) √ n e n . . . (cid:3) = diag [ n, , , . . . ,
0] (45)which is correct. Therefore E n = U n Σ En V Tn , Σ En = diag [ n, , , . . . , , (46)i.e. E n has the same singular-value matrices U n and V n as M n .Using a compounding technique given by Nordgren [8], by (3), (36), and (46), we have A mn = E m ⊗ M n = (cid:0) U m Σ Em V Tm (cid:1) ⊗ (cid:0) U n Σ Mn V Tn (cid:1) = ( U m ⊗ U n ) ( Σ Em ⊗ Σ Mn ) ( V m ⊗ V n ) T = U mn Σ Amn V Tmn , B mn = M m ⊗ E n = (cid:0) U m Σ Mm V Tm (cid:1) ⊗ (cid:0) U n Σ En V Tn (cid:1) (47)= ( U m ⊗ U n ) ( Σ Mm ⊗ Σ En ) ( V m ⊗ V n ) T = U mn Σ Bmn V Tmn , where U mn = U m ⊗ U n , V mn = V m ⊗ V n , Σ Amn = Σ Em ⊗ Σ Mn = m diag [ µ n , σ n , σ n , . . . , σ nn , , . . . , , (48) Σ Bmn = Σ Mm ⊗ Σ En = n diag [ µ m , , . . . , , σ m , , . . . , , σ m , , . . . , , . . . , σ mm , , . . . . Thus, A mn and B mn have the same U mn and V mn and their SVD’s are given by (47). Furthermore,it follows from (31) and (47) that the SVD’s of M Amn and M Bmn are M Amn = U mn Σ AMmn V Tmn , M Bmn = U mn Σ BMmn V Tmn , (49)where Σ AMmn = Σ Amn + m Σ Bmn , Σ BMmn = Σ Bmn + n Σ Amn . (50) Special Case . In the special case where M m = M n ( m = n ) , according to (48), A nn and B nn have the same singular values but they are in a different order in Σ Ann and Σ Bnn . To examine this,by (15) and (47), we form A nn = ( P nn U nn P nn ) (cid:0) P nn Σ Bnn P nn (cid:1) (cid:0) P nn V Tnn P nn (cid:1) − = U nn Σ Ann V Tnn , B nn = ( P nn U nn P nn ) (cid:0) P nn Σ Ann P nn (cid:1) (cid:0) P nn V Tnn P nn (cid:1) − = U nn Σ Bnn V Tnn , (51)whence P nn U nn P nn = U nn , P nn V nn P nn = V nn , Σ Ann = P nn Σ Bnn P nn , Σ Bnn = P nn Σ Ann P nn (52)which indicates the reordering of the same singular values in Σ Ann and Σ Bnn . The SVD’s of M Ann and M Bnn are still given by (49) with singular value matrices from (50). By (50) and (52), we have Σ AMnn = P nn Σ BMnn P nn , Σ BMnn = P nn Σ AMnn P nn (53)which confirms that Σ AMnn and Σ BMnn contain the same singular values and indicates their reordering.Next, numerical examples are given that illustrate and confirm the foregoing theoretical results. Rogers, et. al [13] also give formulas for the SVD of compound matrices. Examples
Order 9.
We construct two order-9, commuting, regular, magic squares by compounding. FollowingRogers, et. al [13], we start with the order-3 Lo-Shu regular magic square M and the all-ones square E , namely M = , E = . (54)We compound these matrices according to (3) to form A = , B = , (55)which are unnatural, regular, magic squares that commute. Since A and B are an orthogonalpair, two commuting, regular, magic squares can be formed from A and B according to (7) as M A = M B =
30 35 28 75 80 73 12 17 1029 31 33 74 76 78 11 13 1534 27 32 79 72 77 16 9 1421 26 19 39 44 37 57 62 5520 22 24 38 40 42 56 58 6025 18 23 43 36 41 61 54 5966 71 64 3 8 1 48 53 4665 67 69 2 4 6 47 49 5170 63 68 7 0 5 52 45 50 ,
30 75 12 35 80 17 28 73 1021 39 57 26 44 62 19 37 5566 3 48 71 8 53 64 1 4629 74 11 31 76 13 33 78 1520 38 56 22 40 58 24 42 6065 2 47 67 4 49 69 6 5134 79 16 27 72 9 32 77 1425 43 61 18 36 54 23 41 5970 7 52 63 0 45 68 5 50 . (56)As noted in [13], M A was known prior to 1000 AD and M B dates to 1275 AD.In addition, as noted in Section 2, a huge number of pairs of commuting magic squares ˜M A and ˜M B can be constructed according to (7) using various combinations of the eight phases of M asthe nine subsquares of generalized ˜A and any phase of M as the basis for B in (3). A regular ˜A results from using any five phases of M as the nine subsquares of ˜A placed in a regular blockpattern, e.g. ˜A = (57)It is easy to see that ˜A and B are orthogonal and they commute since ˜A B = B ˜A = 144 E = ( µ ) E . (58)8hus, as noted in Section 2, commuting regular ˜M A and ˜M B can be formed from them using (7).The permutation matrix P that connects A and B according to (15) is given by (16) as P = . (59)It can be verified that P satisfies (17) and connects A to B and M A to M B according to (15)and (18). Thus, they are pairs of similar matrices as noted in Section 2.In order to see why P works and can be generalized to higher order nn, we consider a general M compounded with E written in block form as B = M ⊗ E = b b b b b b b b b , M = m m m m m m m m m , (60)where b ij is a block that has all elements m ij . Then, the permutation (15) of B can be written as P B P = p p p p p p p p p b b b b b b b b b p p p p p p p p p (61)and on carrying out the matrix multiplication we find that P B P = M M M M M M M M M = E ⊗ M = A . (62)As an example of this matrix multiplication, the element in the first row, second column of P B P is given by p b p + p b p + p b p + p b p + p b p + p b p + p b p + p b p + p b p = m + m + m + m
00 0 00 0 0 + m
00 0 0 + m + m + m (63)+ m = m m m m m m m m m = M . In view of (62), we have verified (15) for n = 3 . It should be clear that a similar verification of (15)applies for higher orders. Also, (17) can be verified in a similar manner.9ext, we construct the Jordan-form matrices of A , B , M A , and M B from the followingJordan-form matrices of M and E : S = i √ − i √ − i √ − − i √ − − i √ − i √ , (64) D M = diag h , i √ , − i √ i , D E = diag [3 , , , where all the eigenvectors in S are simple. As noted in Section 2, the eigenvector matrix S for M is also an eigenvector matrix for E . Also, the eigenvalues of the regular matrix M are µ anda ± pair. By (64) and (28), we obtain the following Jordan-form matrices for A and B : S = i √ − i √ i √ i √ − i √ − − i √ i √ −
44 + 12 i √ − − i √ − i √ i √ − − i √
61 8 + i √ − i √ − i √ −
44 + 12 i √ − i √ − − i √ − i √ − − i √ − − i √ − i √ − i √ i √
61 8 + i √ − i √ − − i √ − − i √ − i √ − − i √ − − i √ i √ − − i √ − i √ − − i √ −
38 + 24 i √
670 8 − i √ − i √ − − i √ − i √ −
20 + 20 i √ − − i √ −
50 + 20 i √ − i √ − − i √ −
14 + 28 i √ −
20 + 20 i √ − − i √ − − i √ − − i √ − − i √ − i √ − − i √ − − i √ −
20 + 20 i √ − i √ − − i √ − i √ −
50 + 20 i √ −
14 + 28 i √ −
20 + 20 i √ − i √ − − i √ − i √ − i √ − − i √ , (65) D A = diag h , i √ , − i √ , , , , , , i , D B = diag h , , , i √ , , , − i √ , , i . (66)Again, the eigenvalues of the regular matrices A and B are µ and ± pairs but in a different orderas related by (34) with (59). Also, (34) for S can be verified. According to (30) and (31), M A and M B have the eigenvector matrix S and eigenvalues360 , i √ , − i √ , i √ , − i √ , , , , , (67)as can be verified directly. These eigenvalues agree with those given by Rogers, et. al [13].10ext, we construct the SVD matrices of A , B , M A , and M B from the following SVD matricesof M and E : U = √ √ √ √ − √ √ − √ √ , V = √ − √ √ √ √ √ − √ − √ , (68) Σ M = diag h , √ , √ i , Σ E = D E = diag [3 , , . The SVD matrices for A , B , M A , and M B are obtained from (48) and (50) as U = 16 √ √ √ √ √ √ − √ √ − √ √ − −√ √ √ − √ √ −√ √ √ − √ − √ −
22 0 − √ − √ −√ √ − √ √ − √ √ −√ − −√ √ √ − √ −√ √ √ − −√ √ −√ −√ √ −√ , (69) V = 16 −√ √ −√ −√ √ −√ √ −√ − √ √ −√ −√ −√ √ √ −√ − −√ √ √ − √ √ √ −√ −√ √ − − √ −√ √ −√ −√ −√ √ −
32 2 √ −√ − −√ − √ −√ −√ −√ √ −√ √ , (70) Σ A = diag h , √ , √ , , , , , , i , Σ B = diag h , , , √ , , , √ , , i , Σ AM = diag h , √ , √ , √ , , , √ , , i , (71) Σ BM = diag h , √ , √ , √ , , , √ , , i which can be verified directly from their SVD definitions (36). Also, (52) can be verified. Thesingular values for M A and M B agree with those given in [13].11 rder 12. We start with the regular magic squares used by Rogers, et. al [13], namely M n = M = , M m = M = . (72)From (3) we form the order-12, commuting regular, unnatural, magic squares A = , (73) B = . (74)Then, (7) gives the commuting, regular, magic squares M A =
39 44 37 30 35 28 138 143 136 75 80 7338 40 42 29 31 33 137 139 141 74 76 7843 36 41 34 27 32 142 135 140 79 72 7793 98 91 120 125 118 12 17 10 57 62 5592 94 96 119 121 123 11 13 15 56 58 6097 90 95 124 117 122 16 9 14 61 54 5984 89 82 129 134 127 21 26 19 48 53 4683 85 87 128 130 132 20 22 24 47 49 5188 81 86 133 126 131 25 18 23 52 45 5066 71 64 3 8 1 111 116 109 102 107 10065 67 69 2 4 6 110 112 114 101 103 10570 63 68 7 0 5 115 108 113 106 99 104 , (75)12 B =
52 132 20 51 131 19 63 143 31 56 136 2436 68 100 35 67 99 47 79 111 40 72 104116 4 84 115 3 83 127 15 95 120 8 8858 138 26 61 141 29 49 129 17 54 134 2242 74 106 45 77 109 33 65 97 38 70 102122 10 90 125 13 93 113 1 81 118 6 8657 137 25 62 142 30 50 130 18 53 133 2141 73 105 46 78 110 34 66 98 37 69 101121 9 89 126 14 94 114 2 82 117 5 8555 135 23 48 128 16 60 140 28 59 139 2739 71 103 32 64 96 44 76 108 43 75 107119 7 87 112 0 80 124 12 92 123 11 91 . (76)The Jordan-form matrices of M and E are given by (64) and those of M are S = −
14 31 −
16 10 −
11 16 6 − − − − , J =
30 0 0 00 0 1 00 0 0 10 0 0 0 , (77)where S has a generalized eigenvector. Then, (28) results in S = i √ − i √ i √ − i √ − i √ − − i √ −
192 + 96 i √ − − i √ − − i √ − i √ − − i √ −
192 + 144 i √
61 8 + i √ − i √ − − − i √ −
128 + 16 i √ − i √ − − i √ −
16 64 − i √ i √ − − i √ − i √ −
16 64 + 48 i √ − i √
61 8 + i √ − i √ i √ − i √ − i √ − − i √ −
64 + 32 i √ − − i √ − − i √ − i √ − − i √ −
64 + 48 i √
61 8 + i √ − i √ − − − i √ −
384 + 48 i √ − i √ − − i √ −
48 192 − i √ i √ − − i √ − i √ −
48 192 + 144 i √ − i √ − − − i √ −
112 + 14 i √ i √ − i √ −
14 56 − i √ i √ −
12 + 6 i √ − − i √ −
14 56 + 42 i √ − i √ − − i √ −
12 + 9 i √
610 80 + 10 i √ − i √ − − − i √ − i √ −
40 + 20 i √ − − i √ − − i √ i √ − − i √ −
40 + 30 i √ − i √ − i √
66 48 + 6 i √ − i √ − − − i √ − i √ −
24 + 12 i √ − − i √ − − i √ i √ − − i √ −
24 + 18 i √ − i √ − i √ − − − i √ −
16 + 2 i √ − − − i √ − i √ − − i √ i √ − − i √ i √ − i √ − i √ − i √ − i √ , (78)13 A = diag h , i √ , − i √ . , . . . , i , J B =
90 0 0 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 0 0 00 0 0 0 0 0 3 0 0 0 0 00 0 0 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 3 0 00 0 0 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 0 0 0 . (79)Although J B is not in standard form, it can be brought there by rearranging and scaling thegeneralized eigenvectors in S without affecting the eigenvalues in J A . From (31), the nonzeroeigenvalues of M A and M B are found to be M A : 858 , i √ , − i √ , M B : 858 , i √ , − i √ . (80)The nonzero eigenvalues of M A agree with those given by Rogers, et. al [13] who do not construct M B . The SVD matrices of M are given by (68) and those of M are U = 110 − √ √
55 5 −√ √
55 5 √ − √ − − √ −√ , V = 110 √ − − √
55 3 √ √ − √ −√ −√ − √ , (81) Σ = diag h , √ , √ , i . The U and V matrices for A , B , M A , and M B can be obtained from (48) with (68) and(81). The singular value matrices from (48), (68), (81) and (50) are Σ A = diag h , √ , √ , , , ..., i , Σ B = diag h , , , √ , , , √ , , , ..., i , Σ AM = diag h , √ , √ , √ , , , √ , , , . . . , i , (82) Σ BM = diag h , √ , √ , √ , , , √ , , , . . . , i . The singular values obtained for M ( A )12 (verified by MAPLE).agree with those of Rogers, et.al [13] except for their24 √ √ √ √
14n addition, as noted by Rogers, et. al [13], a different pair of M A and M B can be constructedby interchanging M m and M n in (72), i.e. M n = M = , M m = M = , (83)leading to the commuting pair of regular magic squares ˆM A =
52 51 63 56 132 131 143 136 20 19 31 2458 61 49 54 138 141 129 134 26 29 17 2257 62 50 53 137 142 130 133 25 30 18 2155 48 60 59 135 128 140 139 23 16 28 2736 35 47 40 68 67 79 72 100 99 111 10442 45 33 38 74 77 65 70 106 109 97 10241 46 34 37 73 78 66 69 105 110 98 10139 32 44 43 71 64 76 75 103 96 108 107116 115 127 120 4 3 15 8 84 83 95 88122 125 113 118 10 13 1 6 90 93 81 86121 126 114 117 9 14 2 5 89 94 82 85119 112 124 123 7 0 12 11 87 80 92 91 , (84) ˆM B =
39 30 138 75 44 35 143 80 37 28 136 7393 120 12 57 98 125 17 62 91 118 10 5584 129 21 48 89 134 26 53 82 127 19 4666 3 111 102 71 8 116 107 64 1 109 10038 29 137 74 40 31 139 76 42 33 141 7892 119 11 56 94 121 13 58 96 123 15 6083 128 20 47 85 130 22 49 87 132 24 5165 2 110 101 67 4 112 103 69 6 114 10543 34 142 79 36 27 135 72 41 32 140 7797 124 16 61 90 117 9 54 95 122 14 5988 133 25 52 81 126 18 45 86 131 23 5070 7 115 106 63 0 108 99 68 5 113 104 . (85)The matrices in the Jordan form and SVD of ˆM A and ˆM B can be constructed as before. It followsfrom formulas in Sections 3 and 4 that the eigenvalues and singular values for ˆM A are the sameas those for M B and the eigenvalues and singular values for ˆM B are the same as those for M A (verified by MAPLE). However, their respective eigenvalue matrices are different and they do notcommute.Again, as noted in Section 2, a huge number of pairs of commuting magic squares M A and M B can be constructed according to (7) using various combinations of phases of M as subsquares ingeneralized ˜A and any M as the basis for B in (3). This same construction applies to ˆM A and ˆM B using various combinations of phases of M as subsquares in generalized ˜A and any M asthe basis for B in (3). 15 rder 16. We start with the order-4 , pandiagonal, magic square equivalent to the one used byChan and Loly [1], namely M =
13 6 11 010 1 12 74 15 2 93 8 5 14 . (86)By compounding according to (3) with M m = M n = M , we form the following order-16, commut-ing, pandiagonal, unnatural magic squares A =
11 0 13 6 11 0 13
11 0 13 6 11 010 1
14 3 8 5 14 3 8 5 1413 6 11 0 13
11 0 13 6 11 0 13 6 11 010 1 12 7
14 3 8 5 14
11 0 13 6 11 0 13
11 0 13 6 11 0
11 010 1 12 7 10 1 12 7 10 1 12 7
74 15 2 9 4 15 2 9 4 15 2
14 3 8 5 14 , (87) B =
13 13
13 6 6 6 6 11 11
11 0 0 0 013 13 13
11 11 0 0 0 013 13 13 13
11 11 11 0 0 0 013 13 13 13 6
11 11 11 11 0 0 0 010 10 10 10 1 1
12 12 12 12 7 7 7 710 10 10 10
12 12 12 7 7 7 710 10 10
12 12 7 7 7 74 4
143 3 3 3 8 8 8 8 5 5 5 5 14
14 14 143
14 14 14 14 . (88)It is not difficult to verify that these two matrices are pandiagonal by comparing their diagonals withthose of M as done by Eggermont [2]. Two such diagonals of A and B are shown in bold. Theelements on the diagonals of A are simply four replications of the diagonals of M . The elementson the diagonals of B are weighted combinations of two adjacent diagonals of M . It should beclear that a similar argument applies to other cases of compounded pandiagonal magic squares . A lenthy formal proof of the pandiagonality of general A mn and B mn is possible but it is not given here. A and B , (7) gives the commuting, pandiagonal, natural, magic squares M A =
221 214 219 208 109 102 107 96 189 182 187 176 13 6 11 0218 209 220 215 106 97 108 103 186 177 188 183 10 1 12 7212 223 210 217 100 111 98 105 180 191 178 185 4 15 2 9211 216 213 222 99 104 101 110 179 184 181 190 3 8 5 14173 166 171 160 29 22 27 16 205 198 203 192 125 118 123 112170 161 172 167 26 17 28 23 202 193 204 199 122 113 124 119164 175 162 169 20 31 18 25 196 207 194 201 116 127 114 121163 168 165 174 19 24 21 30 195 200 197 206 115 120 117 12677 70 75 64 253 246 251 240 45 38 43 32 157 150 155 14474 65 76 71 250 241 252 247 42 33 44 39 154 145 156 15168 79 66 73 244 255 242 249 36 47 34 41 148 159 146 15367 72 69 78 243 248 245 254 35 40 37 46 147 152 149 15861 54 59 48 141 134 139 128 93 86 91 80 237 230 235 22458 49 60 55 138 129 140 135 90 81 92 87 234 225 236 23152 63 50 57 132 143 130 137 84 95 82 89 228 239 226 23351 56 53 62 131 136 133 142 83 88 85 94 227 232 229 238 , (89) M B =
221 109 189 13 214 102 182 6 219 107 187 11 208 96 176 0173 29 205 125 166 22 198 118 171 27 203 123 160 16 192 11277 253 45 157 70 246 38 150 75 251 43 155 64 240 32 14461 141 93 237 54 134 86 230 59 139 91 235 48 128 80 224218 106 186 10 209 97 177 1 220 108 188 12 215 103 183 7170 26 202 122 161 17 193 113 172 28 204 124 167 23 199 11974 250 42 154 65 241 33 145 76 252 44 156 71 247 39 15158 138 90 234 49 129 81 225 60 140 92 236 55 135 87 231212 100 180 4 223 111 191 15 210 98 178 2 217 105 185 9164 20 196 116 175 31 207 127 162 18 194 114 169 25 201 12168 244 36 148 79 255 47 159 66 242 34 146 73 249 41 15352 132 84 228 63 143 95 239 50 130 82 226 57 137 89 233211 99 179 3 216 104 184 8 213 101 181 5 222 110 190 14163 19 195 115 168 24 200 120 165 21 197 117 174 30 206 12667 243 35 147 72 248 40 152 69 245 37 149 78 254 46 15851 131 83 227 56 136 88 232 53 133 85 229 62 142 94 238 , (90)where pandiagonality follows from (7) and the pandiagonality of A and B . The matrix M A essentially agrees with the matrix constructed in [1]. The similar matrices M A and M B are relatedby (18) with P constructed from (16). We leave to the reader the pleasure (or pain) of constructingthe Jordan form and SVD of these order-16 matrices from our formulas for them.Again, as noted in Section 2, a huge number of pairs of commuting magic squares ˜M A and ˜M B can be constructed according to (7) using various 16 combinations of the known 880 M magic squares [11] as the 16 subsquares of generalized ˜A and any M as the basis for B in (3).Pandiagonal ˜M A and ˜M B of this form are not possible in general except by first constructing regular ˜M A and ˜M B using any eight regular M as subsquares of ˜A arranged in a regular block patternand transforming these ˜M A and ˜M B to pandiagonal magic squares by the Planck transformation[12, 7]. 17 Conclusion
Commuting magic square matrices can be formed by compounding two magic square matrices withthe all-ones matrix in a known manner. We verify that the compounded matrices retain the regular(associative) and pandiagonality properties of the original magic squares as noted by Eggermont[2]. In the case where a single matrix is compounded with the all-ones matrix in two ways, thecompounded matrices are related by a row/column permutation (shuffle) of their elements as notedby Rogers, et. al [13] and expressed here in a matrix form which shows that they are similar. Wederive simple formulas for the Jordan-form matrices and SVD matrices of the compounded magicsquare matrices in terms of those of the original magic squares. A wider class of commuting magicsquares is considered but our formulas for the Jordan form and SVD do not apply to them. Threeexamples illustrate the constructions and validate our formulas. The methods presented here shouldapply to other compound matrix constructions, such as the additional ones given in [13].
Acknowledgement.
I am grateful to Peter Loly for a helpful discussion and for providing pertinentpages of Eggermont’s thesis [2] which is no longer available on the internet or elsewhere.
References [1]
W. Chan and P. Loly, Iterative compounding of square matrices to generate large-order magic squares,Mathematics Today, 38 (2002), 113-118. [2]
C. Eggermont, Multimagic Squares, Thesis, Department of Mathematics, Radboud University of Ni-jmegen (2007). [3]
R. A. Horn and C. R. Johnson, Matrix Analysis, 2nd Edition, Cambridge University Press, Cambridge(2013). [4]
P. Loly, I. Cameron, W. Trump, and D. Schindel, Magic square spectra, Linear Algebra and its Appli-cations, 430 (2009), 2659-2680. [5]
R. Mattingly, Even order regular magic squares are singular, American Mathematical Monthly, 107(2000), 777-782. [6]
C. D. Meyer, Matrix Analysis and Applied Linear Algebra, Society for Industrial and Applied Mathe-matics, Philadelphia (2000). [7]
R. Nordgren, On properties of special magic square matrices, Linear Algebra and its Applications, 437(2012), 2009-2025. [8]
R. Nordgren, Compounding commuting matrices, Journal of Advances in Mathematics and ComputerScience, (2019), 1-8. [9] K. Ollerenshaw and D. S. Br´ee, Most-Perfect Pandiagonal Magic Squares: Their Construction andEnumeration, The Institute of Mathematics and its Applications, Southend-on-Sea, UK, (1998). [10]
P. C. Pasles, Benjamin Franklin’s Numbers, Princeton University Press, Princeton, NJ, (2008). [11]
C. A. Pickover, The Zen of Magic Squares, Circles, and Stars, second printing and first paperbackprinting, Princeton University Press, Princeton, NJ, (2003) (original printing and e-book, 2002). [12]
C. Planck, Pandiagonal magic squares of orders 6 and 10 without minimal numbers, Monist, 29 (1919),307-316 .[13]