There are 880 recognized order-4 magic squares. These were first enumerated by Frénicle. In 1910 Dudeney classified the magic squares based on the patterns made by their complementary pairs. He also described many transformations between the squares. More recently Walkington has classified the squares based on features other than complementary pairs, by identifying 255 magic tori that display the 880 squares, and by integrating observations of the different sub-magic 2x2 squares patterns that cover these tori. Prior to his work these sub-magic squares were only considered important when all 2x2 squares had the same sum (i.e. they were compact2). He showed that partial coverage by sub-magic 2x2 squares can be important. There are notable similarities and differences between Dudeney's and Walkington's classifications.
This page classifies the magic squares based on their component base squares rather than their features. Surprisingly this classification also has notable similarities to both Dudeney's and Walkington's classifications. Tables of the Frénicle magic Squares with a comparison of the classifications are shown in Frénicle squares. Feature driven construction of the magic squares from base squares is discussed in Order-4 Magic Square Features
An analysis of the base squares of the 880 order-4 magic squares reveals that the agonals of all of the base squares have even integral distribution (for these order-4 binary base squares that means two 0's and two 1's). Features in base squares that have even integral distribution will be called predictable on these pages because when combining base squares, their behavior is predictable. When four base squares with the same predictable feature are combined then the resulting magic square will also have that feature. Alternatively features can also occur in magic square by using catchup. In this case some or all of the base squares do not have the feature(s) present in the magic square.
The main diagonals of 528 of the magic squares are predictable in all four of their base squares. On these pages magic squares of this type will be called orthodox. The remaining 352 magic squares contain at least two base squares whose main diagonals use catchup. These will be referred to as catchup magic squares. Usually it is just the main diagonals that use catchup in order-4 magic squares. In higher order squares other features may also use catchup.
There are only six linear groupings of two 0's and two 1's. These are shown at right (a-f). From the analysis above, all agonals in the order-4 base squares must have two 0's and two 1's, therefore, these six are the only possible agonals of order-4 base squares.
Eight 0's and eight 1's can be arranged into order-4 base squares so that all four rows and four columns have one of the six lines. There are only 5 different patterns and 90 possible visually different arrangements of those patterns. The 90 visually different base squares are shown in the table below. They are grouped according to their pattern type. All the squares in each colored group can be easily obtained by translation, rotation, and/or transposition of any one member in that group. The base squares on the right half of the table below are complements of the base squares on the left (0's and 1's reversed). In general a base square can always be replaced by its complement to make a different magic square with the same features. See ORDER-4 MAGIC SQUARES USING TWO CATCHUP BASE SQUARES for further discussion of this concept. In the discussion below when complements are mentioned, the pair should always be read as either/or, i.e. B3/B7 means either B3 or B7.
The A, B, and C base squares can all be made from base lines. Magic squares made using just these base squares can be easily generated from just one row and one column of the magic square. They can be easily manipulated to create additional magic squares.
In the table below all of the D squares, the last two rows of the E squares, the last row of the F squares, and the C4 and C8 squares are crossed out. These base squares are not used in any of the order-4 magic squares. Notice that their main diagonals are not complements. The remaining 56 base squares are used in the construction of the 880 order-4 magic squares. The main diagonals of all of these base squares are complements. The crossed out base squares can be used to make semi-magic squares since the agonals sum correctly but those squares are not discussed here.
All of the B squares and C1, C2, C5, C6, F1, F2, F17, and F18 have black borders. The main diagonals of these base squares are predictable. Not all combinations of four of these base squares will generate an orthodox magic square, but the agonals and main diagonals will always sum correctly. Any base square quartet that contain all numbers from 1 to 16 will be an orthodox order-4 magic square. All 528 orthodox order-4 magic squares are constructed from the sixteen base squares given above. The remaining 324 magic squares usually use one or two of these 16 base squares but they also use at least two base squares that do not have predictable main diagonals.
To make an orthodox order-4 magic square from a predictable base square quartet, multiply one square by 8, a second square by 4, the third by two, and the last by 1. Add the resulting squares plus 1 to obtain the magic square . A modifiable example using B1/B5, B2/B6, B3/B7, and B4/B8 is given below. Settings for the 48 pan magic Frénicle magic squares are given at left. For a somewhat different discussion of this construction, see Magic Squares. In the example, any multiplier from 0 to 9 can be entered in the boxes but only a combination of 1, 2, 4, and 8 will give an orthodox magic square. The 1, 2, 4, and 8 multipliers can be arranged in any order giving 24 visually different magic squares. All of these will have a one in the upper left corner of the magic square. Half of the squares are redundant and must be transposed using Frénicle's rules. There are only 12 different Frénicle order-4 magic squares with a 1 in the upper left corner after removing the redundancies. Each Frénicle magic square can appear in eight visually different conformations as shown at right for square 102. The numbers are the multipliers and a c means the complement is used. The last column gives the degrees the magic square is rotated and whether it is transposed.
The B1, B2, B3, and B4 base squares can be replaced by their complements, B5, B6, B7, and B8 respectively. They can be replaced either individually or in combinations. This can be done by clicking on any of the checkboxes on the left side of the headings. All replacements will move the one from the upper left corner to another position in the magic square. There are 16 possible replacement combinations matching the 16 positions in the square. This results in 24x16=384 visually different magic squares. After rearrangements using Frénicle's rules and removal of the redundancies, there are only 48 different magic squares that can be made from the four B type base squares. These are the order-4 panmagic squares shown in the first column of Orthodox Order-4 Magic Squares. They are classified as Dudeney Group I magic squares and Walkington classifies them as T 4.01.
Another group of order-4 magic squares can be made using B1/B5, B2/B6, C1/C5, and C2/C6 base squares as described above. Again using all 24 base square multiplier arrangements and 16 complement replacements, 384 visually different magic squares are produced. Again the number of Frénicle squares is just 48 after removal of the redundancies. These are commonly classified as Dudeney Group II magic squares.
The base squares B3/B7, B4/B8, C1/C5, and C2/C6 give another group of 384 visually different magic squares that reduce to 48 Frénicle squares after removal of redundancies. These are the Dudeney Group III magic squares.
The pattern of complementary pairs in the Dudeney Group II magic squares form X's in each of the quadrants. In the Dudeney Group III magic squares, if one row and one column is translated to the opposite side, the complementary pairs also form an X pattern (move the left column of Group III to the right and the top to the bottom in the figure). All other properties of these two Dudeney groups appear to be the same and Walkington classifies them both as T 4.02.2.
In the latter two groups, the C type base squares have one broken diagonal in each direction that is orthodox while the B base squares have all three. The B type base squares are compact2 and compact3 while the C type base squares are just compact3. The C type base squares are more restrictive in both cases, therefore the magic squares from these combinations are semi-pandiagonal and compact3, the pattern of the C type base squares.
There are two more combinations of two B base squares and two C base squares that form magic squares. These are B1/B5, B4/B8, C1/C5, and C2/C6 and B2/B6, B3/B7, C1/C5, and C2/C6. The two groups generate two different sets of 384 visually different magic squares, 768 total. Each set reduces to the same set of 96 Frénicle squares that are commonly called Dudeney Group V magic squares. Walkington calls them T 4.02.3
Walkington has shown that all 880 order-4 magic squares have at least four sub-magic 2x2 squares that add to the magic sum. An analysis of these sub-magic 2x2 squares indicates that the sub-magic 2x2 base squares of all these sub-magic 2x2 squares are predictable in all of the Frénicle magic squares. The pattern of the sub-magic 2x2 squares of each group of magic squares is shown in the headings in Frénicle squares. All base squares except the D type have at least eight sub-magic 2x2 base squares. The D type have none. The sub-magic 2x2 base square patterns are often different than the sub-magic 2x2 square patterns in the magic squares that are constructed from the base squares.
The result of combining base squares with different sub square patterns is shown at right. Most of the sub-magic 2x2 base squares in the C type base squares and all of the sub-magic 2x2 base squares in the B type base squares add to 2 as shown at right. Notice that a sub-magic 2x2 square is only present in the composite magic square at those positions where a 2 is present in all the sub-magic 2x2 base squares. The composite pattern is different than the pattern of any of its base squares. This same magic square composite pattern occurs in all magic squares composed from two B type squares and both the C1/C5 and C2/C6 base squares. These are the Dudeney Group II, III, and V or Walkington T 4.02.2 and T 4.02.3 magic squares. In a similar way a magic square with just four sub-magic 2x2 squares can be constructed from base squares that have eight or more sub-magic 2x2 base squares.
There are two groups of magic squares that are made using three B base squares and one C base square. The first is made from either B1/B5, B3/B7, B4/B8, and C1/C5 or B2/B6, B3/B7, B4/B8, and C2/C6 and the second from either B1/B5, B2/B6, B3/B7, and C1/C5 or B1/B5, B2/B6, B4/B8, and C2/C6. Each base square quartet generates a separate group of 384 visually different magic squares. The magic squares from the first two base square quartets reduce to the same group of 96 Frénicle squares. The magic squares from the last two base square quartets both reduce to a different group of 96 Frénicle squares. The first group are all the Dudeney Group IV magic squares. The second group are 96 of the Dudeney Group VI magic squares. The other Dudeney Group VI squares belong in the next orthodox group as well as scattered among the catchup groups discussed further below.
The complementary pairs in the Dudeney Group IV squares are all either in adjacent rows or adjacent columns. By translating either a row or a column in the Group VI squares, the Group IV pattern is created (move the left column of Group VI to the right in the figure). All other properties of the two sets of squares described above are the same and Walkington classifies them both as T 4.02.1. Only the Dudeney Group VI squares discussed above are included in this Walkington classification.
The last group of orthodox magic squares is made from either B3/B7, C1/C5, F1/F5, and F2/F6 or B4/B8, C2/C6, F1/F5, and F2/F6. This is the only group of simple orthodox magic squares. Within this group there are eight squares that are partially pan diagonal. They have a broken diagonal adjacent to each of the main diagonals that sums to the magic constant. These broken diagonal are the only feature within the orthodox square division that have a feature that is not predictable. They require catchup in the broken diagonals in order to sum correctly. If the feature was predictable in all the base squares, it would appear in all the magic squares within the group. Catchup will be discussed in the next section.
The example below is similar to the pan diagonal base square example above except that it contains two base squares that employ catchup in their main diagonals. Look at the two main diagonals in the first base square. One sums to 0 and the other to 8. A predictable diagonal would have two 0's and two 2's. It would sum to 4. The main diagonals of the second base square sum to 12 and 4 respectively. A predictable base square's diagonals would sum to 8. Combining the two base squares gives the sum of 12 for both main diagonals, the same as that obtained for predictable base squares with the same multipliers. The first base square created an imbalance in the main diagonals, the second base square is the catchup square which corrects the imbalance.
Only A1/A2, C3/C7, F3/F19, or F4/F20 can create the initial imbalance. One of the main diagonals of these base squares sums to 0 and the other sums to 4. To correct the imbalance, the base squares E1 to E8 or F5 to F12 or their complements must be used. One of the main diagonals of these base squares sums to 3 and the other sums to 1. If the initial base square has a 0 for a diagonal then the corresponding diagonal in the second base square must be 3. A 4 requires the 1 in the second base square.
Rules for manipulating the catchup base square figure are somewhat different than those for the predictable base squares. The two catchup squares must be in the same order for the catchup process to work. The multipliers for the two catchup base squares must be 1 and 2, 2 and 4, or 4 and 8. If they contain any other combination the sum for the diagonals in the magic square will be incorrect. The two catchup squares must be considered as one unit (i.e. base square) for any modification.
The other two base squares will have predictable diagonals and may have either of the remaining multipliers. There are therefore 3!=6 different valid base square multiplier combinations for order-4 magic squares with two catchup base squares. The complements for the two catchup base square unit must also be chosen together. There are therefore just 8 complement combinations. There are 6x8=48 visually different order-4 magic squares that can be made from base square combinations of two catchup base squares and two predictable base squares. After removing redundancies, only 24 different Frénicle magic squares are listed for each set of base square quartets under Order-4 Magic Squares with Two Catchup Base Squares.
There are eight groups of magic squares with two catchup base squares. Each group has four base square quartets that can generate it. Each base square quartet will generate a different group of 48 visually different magic squares (192 in total) that includes two conformations of each Frénicle magic square in the group. The magic squares from each quartet all reduce to the same 24 Frénicle magic squares. The table at right lists the eight conformations for square 271. The table at left is a list of all 24 magic squares for Catchup2 Group 1 that was obtained from the first quarte listed. only one of the two conformations is shown. Many of the conformations are rotated and/or transposed versions of the Frénicle magic squares.
The magic squares in this section appear to be grouped in pairs based on various parameters. The first two groups of squares have an A and an E base square for the catchup base squares and two B base squares for the predictable base squares. The third and fourth groups of magic squares have C and F base squares for catchup and a B and C base square for the predictable base squares. The fifth and sixth groups of magic squares use an F and an E for catchup and a C and F for predictable. And the last two groups use two F's for catchup and a B and an F for predictable. The pairs of groups have similarities in other properties as well.
Walkington always classifies the above pairs together. Dudeney pairs the eight groups of this section into 4 of his groups. But his pairings are different.
The base square quartet in the example has a broken diagonal in each direction that also sums correctly. It is from the first group in the Order-4 Magic Squares with Two Catchup Base Squares table. All the magic squares in group 1 have this property. The magic squares in group 2 have the same property. The broken diagonals are all adjacent to a main diagonal and they employ catchup in the same two squares as the main diagonals. Moving the correct column or row to the opposite side converts a group 1 magic square to a group 2 magic square or vice versa. The main diagonals in the first group become the broken diagonals in the second group and vice versa. This relationship is discussed more in the next section.
Groups three, four, seven and eight are all simple magic squares. Most of the magic squares in groups five and six are also simple but four of the squares in each group have a single broken diagonal next to one main diagonal that adds to the magic sum. This diagonal uses a three part base square catchup series. Magic squares that use three catchup base squares are discussed in the next section.
In order-4 magic squares made using three catchup base squares for their main diagonals, the first square creates an imbalance in the main diagonals as before. This is the setup base square. The second base square just maintains that imbalance. The third base square is the catchup square which corrects the imbalance.
As with the magic squares using two catchup base squares, only A1/A2, C3/C7, F3/F19, or F4/F20 can create the initial imbalance. The same base squares can be used to maintain the imbalance or to correct it. These are base squares E1 to E8 and F5 to F12 or their complements. One of their main diagonals sums to 3 and the other sums to 1. If the initial base square has a 0 for a diagonal then the maintenance and correction squares must have a 1 and a 3 respectively for the same diagonal. An initial 4 requires a 3 and a 1.
The three catchup base squares must be adjacent and in the same order for the catchup to work. They must be treated as a single unit. Their multipliers are either 1, 2, and 4 or 2, 4, and 8. For the first case the sums for one main diagonal are 0, 2, and 12 respectively. For the other main diagonal the sums are 4, 6, and 4. For a predictable square they would be 2, 4, and 8. In each case the sum of the three combined diagonals is 14.
|Base Square Quartet A1/A2+E1/E17+E19/E3+B1/B5|
|Base Square Quartet A1/A2+E2/E18+E20/E4+B2/B6|
|Base Square Quartet A1/A2+E5/E21+E7/E23+B1/B5|
|Base Square Quartet A1/A2+E6/E22+E8/E24+B2/B6|
|Base Square Quartet A1/A2+E1/E17+E19/E3+B1/B5|
|Base Square Quartet A1/A2+E2/E18+E20/E4+B2/B6|
|Base Square Quartet A1/A2+E5/E21+E7/E23+B1/B5|
|Base Square Quartet A1/A2+E6/E22+E8/E24+B2/B6|
The fourth base square has predictable main diagonals and its multiplier will be either 8 or 1 respectively. There are therefore only two different valid base square orders for these magic squares. Since the complements of the three catchup base squares must be invoked together there are only 4 complement combinations. Therefore only 2x4=8 visually different magic squares can be made from each base square quartet, but there are four base square quartets for each group giving 32 visually different magic squares. After removing redundancies, only 4 different Frénicle magic squares are listed for each group under Order-4 Magic Squares with Three Catchup Base Squares.
On the left and right are all the "Visually Different Conformations of 3Catchup Group 1 Frénicle Squares from Four Base Square Quartets". On the left are those with 1, 2, and 4 as the catchup squares multipliers and on the right those with 2, 4, and 8 as multipliers. Each of the four base square quartets gives two visually different versions of each of the four Frénicle magic squares in the group. There are eight visually different versions of each Frénicle magic square. The tables show the Frénicle magic square followed by the four base squares followed by the transformation from the Frénicle magic square to create the visually different square.
In the Order-4 Magic Squares with Three Catchup Base Squares table there are 28 groups of magic squares with three catchup base squares. The groups appear to be further grouped into pairs and sometimes quartets based on various parameters. The most important parameters for pairing groups are the types of base squares and their order. Other features can confirm the pairing. The groups are arranged in the pairs/quartets order. Walkington's classification always agrees with the pairs. This is because half of the magic squares in a torus are in one member of a pair and the other half of the magic squares from that torus are in the other member of the pair. Dudeney's classification often does not correspond to the pairs or quartets.
The first four groups in the Order-4 Magic Squares with Three Catchup Base Squares table all have two broken diagonals that add to the magic sum. These are adjacent to the two main diagonals. The broken diagonals also require three catchup base squares to sum correctly. The example above demonstrates the first group in the Order-4 Magic Squares with Three Catchup Base Squares table.
The next six groups of squares in this section are all simple magic squares with no special features. Groups 11 and 12 also have two broken diagonals that add to the magic sum. These are adjacent to the two main diagonals. The broken diagonals are predictable in all the base squares of these two groups but the main diagonals are not. The remaining groups in this section are all simple magic squares with no special features.
Groups 11 and 12 are related to the Walkington T 4.03.1 squares in Group 7 of the Orthodox magic squares. Groups 11 and 12 are also classified Walkington T 4.03.1. The figure above shows that the different groups are constructed from different base squares but they can easily be converted to each other.
The main diagonals of groups 11 and 12 require three catchup base squares while their broken diagonals are predictable. In the example, moving the bottom row to the top creates a magic square that is in Group 7 of the Orthodox magic squares. In the magic square created the broken diagonals from the 3catchup group 11 magic square have become the main diagonals of one of the Walkington T 4.03.1 magic squares in Orthodox Group 7. The main diagonals have become orthodox and the broken diagonals use three catchup base squares in the new magic square. All 8 squares in groups 11 and 12 can be converted to the 8 squares in Orthodox Group 7 that are Walkington 4.03.1.
The 3catchup group1 squares can be converted to the 3catchup group2 squares, and the 3catchup group3 squares can be converted to the 3catchup group4 squares in a similar manner. The 2catchup group 1 and 2catchup group 2 can also be converted to each other.
The semi-pan diagonal squares in 2catchup group 5 and 2catchup group 6 cannot be converted to another group because they have only one pan diagonal.
|Base Square Quartet A1/A2+E1/E17+E3/E19+E7/E23|
|Base Square Quartet A1/A2+E2/E18+E4/E20+E8/E24|
|Base Square Quartet A1/A2+E5/E21+E23/E7+E19/E3|
|Base Square Quartet A1/A2+E6/E22+E24/E8+E20/E4|
In order-4 magic squares made using four catchup base squares for their main diagonals, the first square creates an imbalance in the main diagonals as before. The second and third base squares maintain that imbalance. The fourth base square is the catchup square which corrects the imbalance.
The first and last catchup base squares cannot be in any other order for the catchup to work. Their multipliers must be 1 and 8. The two center base squares can have multipliers 2 and 4 or 4 and 2 because the sums for their main diagonals are the same allowing them to be interchanged. For the first case the sums for one main diagonal are 0, 2, 4, and 24 respectively. For the other main diagonal the sums are 4, 6, 12 and 8. For a predictable square they would be 2, 4, 8 and 16. In each case the sum of the four combined diagonals is 30.
Because the center two base squares can be exchanged, there are two different valid base square orders for these magic squares. Since the complements of the four catchup base squares must be invoked together there are only 2 complement combinations. Therefore only 2x2=4 visually different magic squares can be made from a base square quartet. There are four base square quartets at the top of each group in this section so there are a total of 16 visually different magic squares in each group. After removing redundancies, only 2 different Frénicle magic squares are listed for each group under MAGIC SQUARES USING FOUR CATCHUP SQUARES.
The table at left shows all possible combinations to the four base square quartets. Each base square quartet generates two visually different versions of the two Frénicle magic squares in the group. Altogether eight visually different versions of each Frénicle magic square are generated.
In the table there are 24 groups of magic squares with four catchup base squares. They appear to be further grouped in pairs and sometimes quartets based on the base square combinations used. The groups are arranged in the pairs/quartets order. All squares in this section are Walkington 4.05.1 and Dudeney Group VI
The example below demonstrates the first group in the Order-4 Magic Squares with Four Catchup Base Squares table. The multipliers must be either 1, 2, 4, and 8 or 1, 4, 2, and 8. The entire quartet must be either the base squares as shown or the complements of all four.