Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Magic square
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Method of superposition== The earliest discovery of the superposition method was made by the Indian mathematician Narayana in the 14th century. The same method was later re-discovered and studied in early 18th century Europe by de la Loubere, Poignard, de La Hire, and Sauveur; and the method is usually referred to as de la Hire's method. Although Euler's work on magic square was unoriginal, he famously conjectured the impossibility of constructing the evenly odd ordered mutually orthogonal [[Graeco-Latin square]]s. This conjecture was disproved in the mid 20th century. For clarity of exposition, two important variations of this method can be distinguished. ===Euler's method=== This method consists in constructing two preliminary squares, which when added together gives the magic square. As a running example, a 3×3 magic square is considered. Each number of the 3×3 natural square by a pair of numbers can be labeled as {{col-begin|width=auto;margin:0.5em auto}} {{col-break|valign=bottom}} {| class="wikitable" style="margin-left:auto;margin-right:auto;text-align:center;width:6em;height:6em;table-layout:fixed;" |- | 1 || 2 || 3 |- | 4 || 5 || 6 |- | 7 || 8 || 9 |} {{col-break|valign=bottom|gap=1em}} {| class="wikitable" style="margin-left:auto;margin-right:auto;text-align:center;width:6em;height:6em;table-layout:fixed;" |- | ''αa'' || ''αb'' || ''αc'' |- | ''βa'' || ''βb'' || ''βc'' |- | ''γa'' || ''γb'' || ''γc'' |} {{col-end}} where every pair of Greek and Latin alphabets, e.g. ''αa'', are meant to be added together, i.e. ''αa'' = ''α'' + ''a''. Here, (''α'', ''β'', ''γ'') = (0, 3, 6) and (''a'', ''b'', ''c'') = (1, 2, 3). The numbers 0, 3, and 6 are referred to as the ''root numbers'' while the numbers 1, 2, and 3 are referred to as the ''primary numbers''. An important general constraint here is * ''a Greek letter is paired with a Latin letter only once''. Thus, the original square can now be split into two simpler squares: {{col-begin|width=auto;margin:0.5em auto}} {{col-break|valign=bottom}} {| class="wikitable" style="margin-left:auto;margin-right:auto;text-align:center;width:6em;height:6em;table-layout:fixed;" |- | ''α'' || ''α'' || ''α'' |- | ''β'' || ''β'' || ''β'' |- | ''γ'' || ''γ'' || ''γ'' |} {{col-break|valign=bottom|gap=1em}} {| class="wikitable" style="margin-left:auto;margin-right:auto;text-align:center;width:6em;height:6em;table-layout:fixed;" |- | ''a'' || ''b'' || ''c'' |- | ''a'' || ''b'' || ''c'' |- | ''a'' || ''b'' || ''c'' |} {{col-end}} The lettered squares are referred to as ''Greek square'' or ''Latin square'' if they are filled with Greek or Latin letters, respectively. A magic square can be constructed by ensuring that the Greek and Latin squares are magic squares too. The converse of this statement is also often, but not always (e.g. bordered magic squares), true: A magic square can be decomposed into a Greek and a Latin square, which are themselves magic squares. Thus the method is useful for both synthesis as well as analysis of a magic square. Lastly, by examining the pattern in which the numbers are laid out in the finished square, it is often possible to come up with a faster algorithm to construct higher order squares that replicate the given pattern, without the necessity of creating the preliminary Greek and Latin squares. During the construction of the 3×3 magic square, the Greek and Latin squares with just three unique terms are much easier to deal with than the original square with nine different terms. The row sum and the column sum of the Greek square will be the same, ''α'' + ''β'' + ''γ'', if * ''each letter appears exactly once in a given column or a row''. This can be achieved by [[cyclic permutation]] of ''α'', ''β'', and ''γ''. Satisfaction of these two conditions ensures that the resulting square is a semi-magic square; and such Greek and Latin squares are said to be ''mutually orthogonal'' to each other. For a given order ''n'', there are at most ''n'' − 1 squares in a set of mutually orthogonal squares, not counting the variations due to permutation of the symbols. This upper bound is exact when ''n'' is a prime number. In order to construct a magic square, we should also ensure that the diagonals sum to magic constant. For this, we have a third condition: * ''either all the letters should appear exactly once in both the diagonals; or in case of odd ordered squares, one of the diagonals should consist entirely of the middle term, while the other diagonal should have all the letters exactly once''. The mutually orthogonal Greek and Latin squares that satisfy the first part of the third condition (that all letters appear in both the diagonals) are said to be ''mutually orthogonal doubly diagonal Graeco-Latin squares''. '''Odd squares:''' For the 3×3 odd square, since ''α'', ''β'', and ''γ'' are in arithmetic progression, their sum is equal to the product of the square's order and the middle term, i.e. ''α'' + ''β'' + ''γ'' = 3 ''β''. Thus, the diagonal sums will be equal if we have ''β''s in the main diagonal and ''α'', ''β'', ''γ'' in the skew diagonal. Similarly, for the Latin square. The resulting Greek and Latin squares and their combination will be as below. The Latin square is just a 90 degree anti-clockwise rotation of the Greek square (or equivalently, flipping about the vertical axis) with the corresponding letters interchanged. Substituting the values of the Greek and Latin letters will give the 3×3 magic square. {{col-begin|width=auto;margin:0.5em auto}} {{col-break|valign=bottom}} {| class="wikitable" style="margin-left:auto;margin-right:auto;text-align:center;width:6em;height:6em;table-layout:fixed;" |- | β || α || γ |- | γ || β || α |- | α || γ || β |} {{col-break|valign=bottom|gap=1em}} {| class="wikitable" style="margin-left:auto;margin-right:auto;text-align:center;width:6em;height:6em;table-layout:fixed;" |- | c || a || b |- | a || b || c |- | b || c || a |} {{col-break|valign=bottom|gap=1em}} {| class="wikitable" style="margin-left:auto;margin-right:auto;text-align:center;width:6em;height:6em;table-layout:fixed;" |- | βc || αa || γb |- | γa || βb || αc |- | αb || γc || βa |} {{col-break|valign=bottom|gap=1em}} {| class="wikitable" style="margin-left:auto;margin-right:auto;text-align:center;width:6em;height:6em;table-layout:fixed;" |- | 6 || 1 || 8 |- | 7 || 5 || 3 |- | 2 || 9 || 4 |} {{col-end}} For the odd squares, this method explains why the Siamese method (method of De la Loubere) and its variants work. This basic method can be used to construct odd ordered magic squares of higher orders. To summarise: * ''For odd ordered squares, to construct Greek square, place the middle term along the main diagonal, and place the rest of the terms along the skew diagonal. The remaining empty cells are filled by diagonal moves. The Latin square can be constructed by rotating or flipping the Greek square, and replacing the corresponding alphabets. The magic square is obtained by adding the Greek and Latin squares.'' A peculiarity of the construction method given above for the odd magic squares is that the middle number (''n''<sup>2</sup> + 1)/2 will always appear at the center cell of the magic square. Since there are (''n'' − 1)! ways to arrange the skew diagonal terms, we can obtain (''n'' − 1)! Greek squares this way; same with the Latin squares. Also, since each Greek square can be paired with (''n'' − 1)! Latin squares, and since for each of Greek square the middle term may be arbitrarily placed in the main diagonal or the skew diagonal (and correspondingly along the skew diagonal or the main diagonal for the Latin squares), we can construct a total of 2 × (''n'' − 1)! × (''n'' − 1)! magic squares using this method. For ''n'' = 3, 5, and 7, this will give 8, 1152, and 1,036,800 different magic squares, respectively. Dividing by 8 to neglect equivalent squares due to rotation and reflections, we obtain 1, 144, and 129,600 essentially different magic squares, respectively. As another example, the construction of 5×5 magic square is given. Numbers are directly written in place of alphabets. The numbered squares are referred to as ''primary square'' or ''root square'' if they are filled with primary numbers or root numbers, respectively. The numbers are placed about the skew diagonal in the root square such that the middle column of the resulting root square has 0, 5, 10, 15, 20 (from bottom to top). The primary square is obtained by rotating the root square counter-clockwise by 90 degrees, and replacing the numbers. The resulting square is an associative magic square, in which every pair of numbers symmetrically opposite to the center sum up to the same value, 26. For e.g., 16+10, 3+23, 6+20, etc. In the finished square, 1 is placed at center cell of bottom row, and successive numbers are placed via elongated knight's move (two cells right, two cells down), or equivalently, bishop's move (two cells diagonally down right). When a collision occurs, the break move is to move one cell up. All the odd numbers occur inside the central diamond formed by 1, 5, 25 and 21, while the even numbers are placed at the corners. The occurrence of the even numbers can be deduced by copying the square to the adjacent sides. The even numbers from four adjacent squares will form a cross. {{col-begin|width=auto;margin:0.5em auto}} {{col-break|valign=bottom}} {| class="wikitable" style="margin-left:auto;margin-right:auto;text-align:center;width:10em;height:10em;table-layout:fixed;" |- | 10 || || || || 5 |- | || 10 || || 20 || |- | || || 10 || || |- | || 0 || || 10 || |- | 15 || || || || 10 |} {{col-break|valign=bottom|gap=1em}} {| class="wikitable" style="margin-left:auto;margin-right:auto;text-align:center;width:10em;height:10em;table-layout:fixed;" |- | 10 || || || 0 || 5 |- | || 10 || || 20 || 0 |- | 0 || || 10 || || |- | || 0 || || 10 || |- | 15 || || 0 || || 10 |} {{col-break|valign=bottom|gap=1em}} {| class="wikitable" style="margin-left:auto;margin-right:auto;text-align:center;width:10em;height:10em;table-layout:fixed;" |- | 10 || 15 || 20 || 0 || 5 |- | 5 || 10 || 15 || 20 || 0 |- | 0 || 5 || 10 || 15 || 20 |- | 20 || 0 || 5 || 10 || 15 |- | 15 || 20 || 0 || 5 || 10 |} {{col-break|valign=bottom|gap=1em}} {| class="wikitable" style="margin-left:auto;margin-right:auto;text-align:center;width:10em;height:10em;table-layout:fixed;" |- | 2 || 1 || 5 || 4 || 3 |- | 1 || 5 || 4 || 3 || 2 |- | 5 || 4 || 3 || 2 || 1 |- | 4 || 3 || 2 || 1 || 5 |- | 3 || 2 || 1 || 5 || 4 |} {{col-break|valign=bottom|gap=1em}} {| class="wikitable" style="margin-left:auto;margin-right:auto;text-align:center;width:14em;height:14em;table-layout:fixed;" |- | style="border-left:solid; border-top:solid;"|12 || style="border-top:solid;"|16 || style="background-color: silver; border-top:solid;"| 25 || style="border-top:solid;"| 4 || style="border-right:solid; border-top:solid;"| 8 |- | style="border-left:solid"|6 || style="background-color: silver;"| 15 || style="background-color: silver;"| 19 || style="background-color: silver;"| 23 || style="border-right:solid"| 2 |- | style="border-left:solid; background-color: silver;"| 5 || style="background-color: silver;"| 9 || style="background-color: silver;"| 13 || style="background-color: silver;"| 17 || style="border-right:solid; background-color: silver;"| 21 |- | style="border-left:solid"|24 || style="background-color: silver;"| 3 || style="background-color: silver;"| 7 || style="background-color: silver;"| 11 || style="border-right:solid"|20 || 24 |- | style="border-left:solid; border-bottom:solid;"|18 || style="border-bottom:solid"|22 || style="background-color: silver; border-bottom:solid;"| 1 || style="border-bottom:solid;"|10 || style="border-right:solid; border-bottom:solid;"|14 || 18 || 22 |- | || || || 4 || 8 || 12 || 16 |- | || || || || 2 || 6 |} {{col-end}} A variation of the above example, where the skew diagonal sequence is taken in different order, is given below. The resulting magic square is the flipped version of the famous Agrippa's Mars magic square. It is an associative magic square and is the same as that produced by Moschopoulos's method. Here the resulting square starts with 1 placed in the cell which is to the right of the centre cell, and proceeds as De la Loubere's method, with downwards-right move. When a collision occurs, the break move is to shift two cells to the right. {{col-begin|width=auto;margin:0.5em auto}} {{col-break|valign=bottom}} {| class="wikitable" style="margin-left:auto;margin-right:auto;text-align:center;width:10em;height:10em;table-layout:fixed;" |- | 10 || || || || 20 |- | || 10 || || 15 || |- | || || 10 || || |- | || 5 || || 10 || |- | 0 || || || || 10 |} {{col-break|valign=bottom|gap=1em}} {| class="wikitable" style="margin-left:auto;margin-right:auto;text-align:center;width:10em;height:10em;table-layout:fixed;" |- | 10 || 0 || 15 || 5 || 20 |- | 20 || 10 || 0 || 15 || 5 |- | 5 || 20 || 10 || 0 || 15 |- | 15 || 5 || 20 || 10 || 0 |- | 0 || 15 || 5 || 20 || 10 |} {{col-break|valign=bottom|gap=1em}} {| class="wikitable" style="margin-left:auto;margin-right:auto;text-align:center;width:10em;height:10em;table-layout:fixed;" |- | 1 || 4 || 2 || 5 || 3 |- | 4 || 2 || 5 || 3 || 1 |- | 2 || 5 || 3 || 1 || 4 |- | 5 || 3 || 1 || 4 || 2 |- | 3 || 1 || 4 || 2 || 5 |} {{col-break|valign=bottom|gap=1em}} {| class="wikitable" style="margin-left:auto;margin-right:auto;text-align:center;width:10em;height:10em;table-layout:fixed;" |- | 11 || 4 || 17 || 10 || 23 |- | 24 || 12 || 5 || 18 || 6 |- | 7 || 25 || 13 || 1 || 19 |- | 20 || 8 || 21 || 14 || 2 |- | 3 || 16 || 9 || 22 || 15 |} {{col-end}} In the previous examples, for the Greek square, the second row can be obtained from the first row by circularly shifting it to the right by one cell. Similarly, the third row is a circularly shifted version of the second row by one cell to the right; and so on. Likewise, the rows of the Latin square is circularly shifted to the left by one cell. The row shifts for the Greek and Latin squares are in mutually opposite direction. It is possible to circularly shift the rows by more than one cell to create the Greek and Latin square. * ''For odd ordered squares, whose order is not divisible by three, we can create the Greek squares by shifting a row by two places to the left or to the right to form the next row. The Latin square is made by flipping the Greek square along the main diagonal and interchanging the corresponding letters. This gives us a Latin square whose rows are created by shifting the row in the direction opposite to that of the Greek square. A Greek square and a Latin square should be paired such that their row shifts are in mutually opposite direction. The magic square is obtained by adding the Greek and Latin squares. When the order also happens to be a prime number, this method always creates pandiagonal magic square.'' This essentially re-creates the knight's move. All the letters will appear in both the diagonals, ensuring correct diagonal sum. Since there are ''n''! permutations of the Greek letters by which we can create the first row of the Greek square, there are thus ''n''! Greek squares that can be created by shifting the first row in one direction. Likewise, there are ''n''! such Latin squares created by shifting the first row in the opposite direction. Since a Greek square can be combined with any Latin square with opposite row shifts, there are ''n''! × ''n''! such combinations. Lastly, since the Greek square can be created by shifting the rows either to the left or to the right, there are a total of 2 × ''n''! × ''n''! magic squares that can be formed by this method. For ''n'' = 5 and 7, since they are prime numbers, this method creates 28,800 and 50,803,200 pandiagonal magic squares. Dividing by 8 to neglect equivalent squares due to rotation and reflections, we obtain 3,600 and 6,350,400 equivalent squares. Further dividing by ''n''<sup>2</sup> to neglect equivalent panmagic squares due to cyclic shifting of rows or columns, we obtain 144 and 129,600 essentially different panmagic squares. For order 5 squares, these are the only panmagic square there are. The condition that the square's order not be divisible by 3 means that we cannot construct squares of orders 9, 15, 21, 27, and so on, by this method. In the example below, the square has been constructed such that 1 is at the center cell. In the finished square, the numbers can be continuously enumerated by the knight's move (two cells up, one cell right). When collision occurs, the break move is to move one cell up, one cell left. The resulting square is a pandiagonal magic square. This square also has a further diabolical property that any five cells in [[quincunx]] pattern formed by any odd sub-square, including wrap around, sum to the magic constant, 65. For e.g., 13+7+1+20+24, 23+1+9+15+17, 13+21+10+19+2 etc. Also the four corners of any 5×5 square and the central cell, as well as the middle cells of each side together with the central cell, including wrap around, give the magic sum: 13+10+19+22+1 and 20+24+12+8+1. Lastly the four rhomboids that form elongated crosses also give the magic sum: 23+1+9+24+8, 15+1+17+20+12, 14+1+18+13+19, 7+1+25+22+10. Such squares with 1 at the center cell are also called God's magic squares in Islamic amulet design, where the center cell is either left blank or filled with God's name.<ref name="Cammann1969a"/> {{col-begin|width=auto;margin:0.5em auto}} {{col-break|valign=bottom}} {| class="wikitable" style="margin-left:auto;margin-right:auto;text-align:center;width:10em;height:10em;table-layout:fixed;" |- | 10 || 15 || 20 || 0 || 5 |- | 0 || 5 || 10 || 15 || 20 |- | 15 || 20 || 0 || 5 || 10 |- | 5 || 10 || 15 || 20 || 0 |- | 20 || 0 || 5 || 10 || 15 |- |} {{col-break|valign=bottom|gap=1em}} {| class="wikitable" style="margin-left:auto;margin-right:auto;text-align:center;width:10em;height:10em;table-layout:fixed;" |- | 3 || 1 || 4 || 2 || 5 |- | 4 || 2 || 5 || 3 || 1 |- | 5 || 3 || 1 || 4 || 2 |- | 1 || 4 || 2 || 5 || 3 |- | 2 || 5 || 3 || 1 || 4 |} {{col-break|valign=bottom|gap=1em}} {| class="wikitable" style="margin-left:auto;margin-right:auto;text-align:center;width:10em;height:10em;table-layout:fixed;" |- | 13 || 16 || 24 || 2 || 10 |- | 4 || 7 || 15 || 18 || 21 |- | 20 || 23 || 1 || 9 || 12 |- | 6 || 14 || 17 || 25 || 3 |- | 22 || 5 || 8 || 11 || 19 |} {{col-end}} We can also combine the Greek and Latin squares constructed by different methods. In the example below, the primary square is made using knight's move. We have re-created the magic square obtained by De la Loubere's method. As before, we can form 8 × (''n'' − 1)! × ''n''! magic squares by this combination. For ''n'' = 5 and 7, this will create 23,040 and 29,030,400 magic squares. After dividing by 8 in order to neglect equivalent squares due to rotation and reflection, we get 2,880 and 3,628,800 squares. {{col-begin|width=auto;margin:0.5em auto}} {{col-break|valign=bottom}} {| class="wikitable" style="margin-left:auto;margin-right:auto;text-align:center;width:10em;height:10em;table-layout:fixed;" |- | 15 || 20 || 0 || 5 || 10 |- | 20 || 0 || 5 || 10 || 15 |- | 0 || 5 || 10 || 15 || 20 |- | 5 || 10 || 15 || 20 || 0 |- | 10 || 15 || 20 || 0 || 5 |- |} {{col-break|valign=bottom|gap=1em}} {| class="wikitable" style="margin-left:auto;margin-right:auto;text-align:center;width:10em;height:10em;table-layout:fixed;" |- | 2 || 4 || 1 || 3 || 5 |- | 3 || 5 || 2 || 4 || 1 |- | 4 || 1 || 3 || 5 || 2 |- | 5 || 2 || 4 || 1 || 3 |- | 1 || 3 || 5 || 2 || 4 |} {{col-break|valign=bottom|gap=1em}} {| class="wikitable" style="margin-left:auto;margin-right:auto;text-align:center;width:10em;height:10em;table-layout:fixed;" |- | 17 || 24 || 1 || 8 || 15 |- | 23 || 5 || 7 || 14 || 16 |- | 4 || 6 || 13 || 20 || 22 |- | 10 || 12 || 19 || 21 || 3 |- | 11 || 18 || 25 || 2 || 9 |} {{col-end}} For order 5 squares, these three methods give a complete census of the number of magic squares that can be constructed by the method of superposition. Neglecting the rotation and reflections, the total number of magic squares of order 5 produced by the superposition method is 144 + 3,600 + 2,880 = 6,624. '''Even squares:''' We can also construct even ordered squares in this fashion. Since there is no middle term among the Greek and Latin alphabets for even ordered squares, in addition to the first two constraint, for the diagonal sums to yield the magic constant, all the letters in the alphabet should appear in the main diagonal and in the skew diagonal. An example of a 4×4 square is given below. For the given diagonal and skew diagonal in the Greek square, the rest of the cells can be filled using the condition that each letter appear only once in a row and a column. {{col-begin|width=auto;margin:0.5em auto}} {{col-break|valign=bottom}} {| class="wikitable" style="margin-left:auto;margin-right:auto;text-align:center;width:8em;height:8em;table-layout:fixed;" |- | α || || || δ |- | || δ || α || |- | || γ || β || |- | β || || || γ |} {{col-break|valign=bottom|gap=1em}} {| class="wikitable" style="margin-left:auto;margin-right:auto;text-align:center;width:8em;height:8em;table-layout:fixed;" |- | α || β || γ || δ |- | γ || δ || α || β |- | δ || γ || β || α |- | β || α || δ || γ |} {{col-break|valign=bottom|gap=1em}} {| class="wikitable" style="margin-left:auto;margin-right:auto;text-align:center;width:8em;height:8em;table-layout:fixed;" |- | a || b || c || d |- | d || c || b || a |- | b || a || d || c |- | c || d || a || b |} {{col-break|valign=bottom|gap=1em}} {| class="wikitable" style="margin-left:auto;margin-right:auto;text-align:center;width:8em;height:8em;table-layout:fixed;" |- | αa || βb || γc || δd |- | γd || δc || αb || βa |- | δb || γa || βd || αc |- | βc || αd || δa || γb |} {{col-break|valign=bottom|gap=1em}} {| class="wikitable" style="margin-left:auto;margin-right:auto;text-align:center;width:8em;height:8em;table-layout:fixed;" |- | 1 || 6 || 11 || 16 |- | 12 || 15 || 2 || 5 |- | 14 || 9 || 8 || 3 |- | 7 || 4 || 13 || 10 |} {{col-end}} Using these two Graeco-Latin squares, we can construct 2 × 4! × 4! = 1,152 magic squares. Dividing by 8 to eliminate equivalent squares due to rotation and reflections, we get 144 essentially different magic squares of order 4. These are the only magic squares constructible by the Euler method, since there are only two mutually orthogonal doubly diagonal Graeco-Latin squares of order 4. Similarly, an 8×8 magic square can be constructed as below. Here the order of appearance of the numbers is not important; however the quadrants imitate the layout pattern of the 4×4 Graeco-Latin squares. {{col-begin|width=auto;margin:0.5em auto}} {{col-break|valign=bottom}} {| class="wikitable" style="margin-left:auto;margin-right:auto;text-align:center;width:16em;height:16em;table-layout:fixed;" |- | 0 || 8 || 16 || 24 || 32 || 40 || 48 || 56 |- | 24 || 16 || 8 || 0 || 56 || 48 || 40 || 32 |- | 48 || 56 || 32 || 40 || 16 || 24 || 0 || 8 |- | 40 || 32 || 56 || 48 || 8 || 0 || 24 || 16 |- | 56 || 48 || 40 || 32 || 24 || 16 || 8 || 0 |- | 32 || 40 || 48 || 56 || 0 || 8 || 16 || 24 |- | 8 || 0 || 24 || 16 || 40 || 32 || 56 || 48 |- | 16 || 24 || 0 || 8 || 48 || 56 || 32 || 40 |} {{col-break|valign=bottom|gap=1em}} {| class="wikitable" style="margin-left:auto;margin-right:auto;text-align:center;width:16em;height:16em;table-layout:fixed;" |- | 1 || 2 || 3 || 4 || 5 || 6 || 7 || 8 |- | 3 || 4 || 1 || 2 || 7 || 8 || 5 || 6 |- | 5 || 6 || 7 || 8 || 1 || 2 || 3 || 4 |- | 7 || 8 || 5 || 6 || 3 || 4 || 1 || 2 |- | 4 || 3 || 2 || 1 || 8 || 7 || 6 || 5 |- | 2 || 1 || 4 || 3 || 6 || 5 || 8 || 7 |- | 8 || 7 || 6 || 5 || 4 || 3 || 2 || 1 |- | 6 || 5 || 8 || 7 || 2 || 1 || 4 || 3 |} {{col-break|valign=bottom|gap=1em}} {| class="wikitable" style="margin-left:auto;margin-right:auto;text-align:center;width:16em;height:16em;table-layout:fixed;" |- | 1 || 10 || 19 || 28 || 37 || 46 || 55 || 64 |- | 27 || 20 || 9 || 2 || 63 || 56 || 45 || 38 |- | 53 || 62 || 39 || 48 || 17 || 26 || 3 || 12 |- | 47 || 40 || 61 || 54 || 11 || 4 || 25 || 18 |- | 60 || 51 || 42 || 33 || 32 || 23 || 14 || 5 |- | 34 || 41 || 52 || 59 || 6 || 13 || 24 || 31 |- | 16 || 7 || 30 || 21 || 44 || 35 || 58 || 49 |- | 22 || 29 || 8 || 15 || 50 || 57 || 36 || 43 |} {{col-end}} Euler's method has given rise to the study of [[Graeco-Latin square]]s. Euler's method for constructing magic squares is valid for any order except 2 and 6. '''Variations''': Magic squares constructed from mutually orthogonal doubly diagonal Graeco-Latin squares are interesting in themselves since the magic property emerges from the relative position of the alphabets in the square, and not due to any arithmetic property of the value assigned to them. This means that we can assign any value to the alphabets of such squares and still obtain a magic square. This is the basis for constructing squares that display some information (e.g. birthdays, years, etc.) in the square and for creating "reversible squares". For example, we can display the number ''π'' ≈ {{val|3.141592}} at the bottom row of a 4×4 magic square using the Graeco-Latin square given above by assigning (''α'', ''β'', ''γ'', ''δ'') = (10, 0, 90, 15) and (''a'', ''b'', ''c'', ''d'') = (0, 2, 3, 4). We will obtain the following non-normal magic square with the magic sum 124: {| class="wikitable" style="margin-left:auto;margin-right:auto;text-align:center;width:8em;height:8em;table-layout:fixed;" |- | 10 || 2 || 93 || 19 |- | 94 || 18 || 12 || 0 |- | 17 || 90 || 4 || 13 |- | 3 || 14 || 15 || 92 |} ===Narayana-De la Hire's method for even orders=== Narayana-De la Hire's method for odd square is the same as that of Euler's. However, for even squares, we drop the second requirement that each Greek and Latin letter appear only once in a given row or column. This allows us to take advantage of the fact that the sum of an arithmetic progression with an even number of terms is equal to the sum of two opposite symmetric terms multiplied by half the total number of terms. Thus, when constructing the Greek or Latin squares, * ''for even ordered squares, a letter can appear ''n''/2 times in a column but only once in a row, or vice versa.'' As a running example, if we take a 4×4 square, where the Greek and Latin terms have the values (''α'', ''β'', ''γ'', ''δ'') = (0, 4, 8, 12) and (''a'', ''b'', ''c'', ''d'') = (1, 2, 3, 4), respectively, then we have ''α'' + ''β'' + ''γ'' + ''δ'' = 2 (''α'' + ''δ'') = 2 (''β'' + ''γ''). Similarly, ''a'' + ''b'' + ''c'' + ''d'' = 2 (''a'' + ''d'') = 2 (''b'' + ''c''). This means that the complementary pair ''α'' and ''δ'' (or ''β'' and ''γ'') can appear twice in a column (or a row) and still give the desired magic sum. Thus, we can construct: * ''For even ordered squares, the Greek magic square is made by first placing the Greek alphabets along the main diagonal in some order. The skew diagonal is then filled in the same order or by picking the terms that are complementary to the terms in the main diagonal. Finally, the remaining cells are filled column wise. Given a column, we use the complementary terms in the diagonal cells intersected by that column, making sure that they appear only once in a given row but ''n''/2 times in the given column. The Latin square is obtained by flipping or rotating the Greek square and interchanging the corresponding alphabets. The final magic square is obtained by adding the Greek and Latin squares.'' In the example given below, the main diagonal (from top left to bottom right) is filled with sequence ordered as ''α'', ''β'', ''γ'', ''δ'', while the skew diagonal (from bottom left to top right) filled in the same order. The remaining cells are then filled column wise such that the complementary letters appears only once within a row, but twice within a column. In the first column, since ''α'' appears on the 1st and 4th row, the remaining cells are filled with its complementary term ''δ''. Similarly, the empty cells in the 2nd column are filled with ''γ''; in 3rd column ''β''; and 4th column ''α''. Each Greek letter appears only once along the rows, but twice along the columns. As such, the row sums are ''α'' + ''β'' + ''γ'' + ''δ'' while the column sums are either 2 (''α'' + ''δ'') or 2 (''β'' + ''γ''). Likewise for the Latin square, which is obtained by flipping the Greek square along the main diagonal and interchanging the corresponding letters. {{col-begin|width=auto;margin:0.5em auto}} {{col-break|valign=bottom}} {| class="wikitable" style="margin-left:auto;margin-right:auto;text-align:center;width:8em;height:8em;table-layout:fixed;" |- | α || || || δ |- | || β || γ || |- | || β || γ || |- | α || || || δ |} {{col-break|valign=bottom|gap=1em}} {| class="wikitable" style="margin-left:auto;margin-right:auto;text-align:center;width:8em;height:8em;table-layout:fixed;" |- | α || γ || β || δ |- | δ || β || γ || α |- | δ || β || γ || α |- | α || γ || β || δ |} {{col-break|valign=bottom|gap=1em}} {| class="wikitable" style="margin-left:auto;margin-right:auto;text-align:center;width:8em;height:8em;table-layout:fixed;" |- | a || d || d || a |- | c || b || b || c |- | b || c || c || b |- | d || a || a || d |} {{col-break|valign=bottom|gap=1em}} {| class="wikitable" style="margin-left:auto;margin-right:auto;text-align:center;width:8em;height:8em;table-layout:fixed;" |- | αa || γd || βd || δa |- | δc || βb || γb || αc |- | δb || βc || γc || αb |- | αd || γa || βa || δd |} {{col-break|valign=bottom|gap=1em}} {| class="wikitable" style="margin-left:auto;margin-right:auto;text-align:center;width:8em;height:8em;table-layout:fixed;" |- | style="background-color: silver;"|1 || 12 || 8 || style="background-color: silver;"|13 |- | 15 || style="background-color: silver;"|6 || style="background-color: silver;"|10 || 3 |- | 14 || style="background-color: silver;"|7 || style="background-color: silver;"|11 || 2 |- | style="background-color: silver;"|4 || 9 || 5 || style="background-color: silver;"|16 |} {{col-end}} The above example explains why the "criss-cross" method for doubly even magic square works. Another possible 4×4 magic square, which is also pan-diagonal as well as most-perfect, is constructed below using the same rule. However, the diagonal sequence is chosen such that all four letters ''α'', ''β'', ''γ'', ''δ'' appear inside the central 2×2 sub-square. Remaining cells are filled column wise such that each letter appears only once within a row. In the 1st column, the empty cells need to be filled with one of the letters selected from the complementary pair ''α'' and ''δ''. Given the 1st column, the entry in the 2nd row can only be ''δ'' since ''α'' is already there in the 2nd row; while, in the 3rd row the entry can only be ''α'' since ''δ'' is already present in the 3rd row. We proceed similarly until all cells are filled. The Latin square given below has been obtained by flipping the Greek square along the main diagonal and replacing the Greek alphabets with corresponding Latin alphabets. {{col-begin|width=auto;margin:0.5em auto}} {{col-break|valign=bottom}} {| class="wikitable" style="margin-left:auto;margin-right:auto;text-align:center;width:8em;height:8em;table-layout:fixed;" |- | α || || || γ |- | || γ || α || |- | || β || δ || |- | δ || || || β |} {{col-break|valign=bottom|gap=1em}} {| class="wikitable" style="margin-left:auto;margin-right:auto;text-align:center;width:8em;height:8em;table-layout:fixed;" |- | α || β || δ || γ |- | δ || γ || α || β |- | α || β || δ || γ |- | δ || γ || α || β |} {{col-break|valign=bottom|gap=1em}} {| class="wikitable" style="margin-left:auto;margin-right:auto;text-align:center;width:8em;height:8em;table-layout:fixed;" |- | a || d || a || d |- | b || c || b || c |- | d || a || d || a |- | c || b || c || b |} {{col-break|valign=bottom|gap=1em}} {| class="wikitable" style="margin-left:auto;margin-right:auto;text-align:center;width:8em;height:8em;table-layout:fixed;" |- | αa || βd || δa || γd |- | δb || γc || αb || βc |- | αd || βa || δd || γa |- | δc || γb || αc || βb |} {{col-break|valign=bottom|gap=1em}} {| class="wikitable" style="margin-left:auto;margin-right:auto;text-align:center;width:8em;height:8em;table-layout:fixed;" |- | 1 || 8 || 13 || 12 |- | 14 || 11 || 2 || 7 |- | 4 || 5 || 16 || 9 |- | 15 || 10 || 3 || 6 |} {{col-end}} We can use this approach to construct singly even magic squares as well. However, we have to be more careful in this case since the criteria of pairing the Greek and Latin alphabets uniquely is not automatically satisfied. Violation of this condition leads to some missing numbers in the final square, while duplicating others. Thus, here is an important proviso: * ''For singly even squares, in the Greek square, check the cells of the columns which is vertically paired to its complement. In such a case, the corresponding cell of the Latin square must contain the same letter as its horizontally paired cell.'' Below is a construction of a 6×6 magic square, where the numbers are directly given, rather than the alphabets. The second square is constructed by flipping the first square along the main diagonal. Here in the first column of the root square the 3rd cell is paired with its complement in the 4th cells. Thus, in the primary square, the numbers in the 1st and 6th cell of the 3rd row are same. Likewise, with other columns and rows. In this example the flipped version of the root square satisfies this proviso. {{col-begin|width=auto;margin:0.5em auto}} {{col-break|valign=bottom}} {| class="wikitable" style="margin-left:auto;margin-right:auto;text-align:center;width:12em;height:12em;table-layout:fixed;" |- | 0 || '''24''' || 18 || 12 || '''6''' || 30 |- | 30 || 6 || '''12''' || '''18''' || 24 || 0 |- | '''0''' || 24 || 12 || 18 || 6 || '''30''' |- | '''30''' || 24 || 12 || 18 || 6 || '''0''' |- | 30 || 6 || '''18''' || '''12''' || 24 || 0 |- | 0 || '''6''' || 18 || 12 || '''24''' || 30 |} {{col-break|valign=bottom|gap=1em}} {| class="wikitable" style="margin-left:auto;margin-right:auto;text-align:center;width:12em;height:12em;table-layout:fixed;" |- | 1 || '''6''' || 1 || 6 || '''6''' || 1 |- | 5 || 2 || '''5''' || '''5''' || 2 || 2 |- | '''4''' || 3 || 3 || 3 || 4 || '''4''' |- | '''3''' || 4 || 4 || 4 || 3 || '''3''' |- | 2 || 5 || '''2''' || '''2''' || 5 || 5 |- | 6 || '''1''' || 6 || 1 || '''1''' || 6 |} {{col-break|valign=bottom|gap=1em}} {| class="wikitable" style="margin-left:auto;margin-right:auto;text-align:center;width:12em;height:12em;table-layout:fixed;" |- | 1 || 30 || 19 || 18 || 12 || 31 |- | 35 || 8 || 17 || 23 || 26 || 2 |- | 4 || 27 || 15 || 21 || 10 || 34 |- | 33 || 28 || 16 || 22 || 9 || 3 |- | 32 || 11 || 20 || 14 || 29 || 5 |- | 6 || 7 || 24 || 13 || 25 || 36 |} {{col-end}} As another example of a 6×6 magic square constructed this way is given below. Here the diagonal entries are arranged differently. The primary square is constructed by flipping the root square about the main diagonal. In the second square the proviso for singly even square is not satisfied, leading to a non-normal magic square (third square) where the numbers 3, 13, 24, and 34 are duplicated while missing the numbers 4, 18, 19, and 33. {{col-begin|width=auto;margin:0.5em auto}} {{col-break|valign=bottom}} {| class="wikitable" style="margin-left:auto;margin-right:auto;text-align:center;width:12em;height:12em;table-layout:fixed;" |- | 6 || 30 || 12 || 18 || 0 || 24 |- | 24 || 0 || '''12''' || '''18''' || 30 || 6 |- | '''24''' || '''0''' || 18 || 12 || '''30''' || '''6''' |- | '''6''' || '''30''' || 18 || 12 || '''0''' || '''24''' |- | 24 || 0 || '''18''' || '''12''' || 30 || 6 |- | 6 || 30 || 12 || 18 || 0 || 24 |} {{col-break|valign=bottom|gap=1em}} {| class="wikitable" style="margin-left:auto;margin-right:auto;text-align:center;width:12em;height:12em;table-layout:fixed;" |- | 2 || 5 || 5 || 2 || 5 || 2 |- | 6 || 1 || '''1''' || '''6''' || 1 || 6 |- | '''3''' || '''3''' || 4 || 4 || '''4''' || '''3''' |- | '''4''' || '''4''' || 3 || 3 || '''3''' || '''4''' |- | 1 || 6 || '''6''' || '''1''' || 6 || 1 |- | 5 || 2 || 2 || 5 || 2 || 5 |} {{col-break|valign=bottom|gap=1em}} {| class="wikitable" style="margin-left:auto;margin-right:auto;text-align:center;width:12em;height:12em;table-layout:fixed;" |- | 8 || 35 || 17 || 20 || 5 || 26 |- | 30 || 1 || '''13''' || '''24''' || 31 || 12 |- | 27 || '''3''' || 22 || 16 || '''34''' || 9 |- | 10 || '''34''' || 21 || 15 || '''3''' || 28 |- | 25 || 6 || '''24''' || '''13''' || 36 || 7 |- | 11 || 32 || 14 || 23 || 2 || 29 |} {{col-end}} The last condition is a bit arbitrary and may not always need to be invoked, as in this example, where in the root square each cell is vertically paired with its complement: {{col-begin|width=auto;margin:0.5em auto}} {{col-break|valign=bottom}} {| class="wikitable" style="margin-left:auto;margin-right:auto;text-align:center;width:12em;height:12em;table-layout:fixed;" |- | 6 || 30 || 12 || 24 || 18 || 0 |- | 6 || 0 || 18 || 24 || 12 || 30 |- | 24 || 0 || 12 || 6 || 18 || 30 |- | 6 || 30 || 18 || 24 || 12 || 0 |- | 24 || 30 || 12 || 6 || 18 || 0 |- | 24 || 0 || 18 || 6 || 12 || 30 |} {{col-break|valign=bottom|gap=1em}} {| class="wikitable" style="margin-left:auto;margin-right:auto;text-align:center;width:12em;height:12em;table-layout:fixed;" |- | 2 || 2 || 5 || 2 || 5 || 5 |- | 6 || 1 || 1 || 6 || 6 || 1 |- | 3 || 4 || 3 || 4 || 3 || 4 |- | 5 || 5 || 2 || 5 || 2 || 2 |- | 4 || 3 || 4 || 3 || 4 || 3 |- | 1 || 6 || 6 || 1 || 1 || 6 |} {{col-break|valign=bottom|gap=1em}} {| class="wikitable" style="margin-left:auto;margin-right:auto;text-align:center;width:12em;height:12em;table-layout:fixed;" |- | 8 || 32 || 17 || 26 || 23 || 5 |- | 12 || 1 || 19 || 30 || 18 || 31 |- | 27 || 4 || 15 || 10 || 21 || 34 |- | 11 || 35 || 20 || 29 || 14 || 2 |- | 28 || 33 || 16 || 9 || 22 || 3 |- | 25 || 6 || 24 || 7 || 13 || 36 |} {{col-end}} As one more example, we have generated an 8×8 magic square. Unlike the criss-cross pattern of the earlier section for evenly even square, here we have a checkered pattern for the altered and unaltered cells. Also, in each quadrant the odd and even numbers appear in alternating columns. {{col-begin|width=auto;margin:0.5em auto}} {{col-break|valign=bottom}} {| class="wikitable" style="margin-left:auto;margin-right:auto;text-align:center;width:16em;height:16em;table-layout:fixed;" |- | 0 || 48 || 16 || 32 || 24 || 40 || 8 || 56 |- | 56 || 8 || 40 || 24 || 32 || 16 || 48 || 0 |- | 0 || 48 || 16 || 32 || 24 || 40 || 8 || 56 |- | 56 || 8 || 40 || 24 || 32 || 16 || 48 || 0 |- | 56 || 8 || 40 || 24 || 32 || 16 || 48 || 0 |- | 0 || 48 || 16 || 32 || 24 || 40 || 8 || 56 |- | 56 || 8 || 40 || 24 || 32 || 16 || 48 || 0 |- | 0 || 48 || 16 || 32 || 24 || 40 || 8 || 56 |} {{col-break|valign=bottom|gap=1em}} {| class="wikitable" style="margin-left:auto;margin-right:auto;text-align:center;width:16em;height:16em;table-layout:fixed;" |- | 1 || 8 || 1 || 8 || 8 || 1 || 8 || 1 |- | 7 || 2 || 7 || 2 || 2 || 7 || 2 || 7 |- | 3 || 6 || 3 || 6 || 6 || 3 || 6 || 3 |- | 5 || 4 || 5 || 4 || 4 || 5 || 4 || 5 |- | 4 || 5 || 4 || 5 || 5 || 4 || 5 || 4 |- | 6 || 3 || 6 || 3 || 3 || 6 || 3 || 6 |- | 2 || 7 || 2 || 7 || 7 || 2 || 7 || 2 |- | 8 || 1 || 8 || 1 || 1 || 8 || 1 || 8 |} {{col-break|valign=bottom|gap=1em}} {| class="wikitable" style="margin-left:auto;margin-right:auto;text-align:center;width:16em;height:16em;table-layout:fixed;" |- | style="background-color: silver;"|1 || 56 || style="background-color: silver;"|17 || 40 || 32 || style="background-color: silver;"|41 || 16 || style="background-color: silver;"|57 |- | 63 ||style="background-color: silver;"| 10 || 47 || style="background-color: silver;"|26 || style="background-color: silver;"|34 || 23 || style="background-color: silver;"|50 || 7 |- | style="background-color: silver;"|3 || 54 || style="background-color: silver;"|19 || 38 || 30 || style="background-color: silver;"|43 || 14 || style="background-color: silver;"|59 |- | 61 || style="background-color: silver;"|12 || 45 || style="background-color: silver;"|28 || style="background-color: silver;"|36 || 21 || style="background-color: silver;"|42 || 5 |- | 60 || style="background-color: silver;"|13 || 44 || style="background-color: silver;"|29 || style="background-color: silver;"|37 || 20 || style="background-color: silver;"|53 || 4 |- | style="background-color: silver;"|6 || 51 || style="background-color: silver;"|22 || 35 || 27 || style="background-color: silver;"|46 || 11 || style="background-color: silver;"|62 |- | 58 || style="background-color: silver;"|15 || 42 || style="background-color: silver;"|31 || style="background-color: silver;"|39 || 18 || style="background-color: silver;"|55 || 2 |- | style="background-color: silver;"|8 || 47 || style="background-color: silver;"|24 || 33 || 25 || style="background-color: silver;"|48 || 9 || style="background-color: silver;"|64 |} {{col-end}} '''Variations''': A number of variations of the basic idea are possible: ''a complementary pair can appear ''n''/2 times or less in a column''. That is, a column of a Greek square can be constructed using more than one complementary pair. This method allows us to imbue the magic square with far richer properties. The idea can also be extended to the diagonals too. An example of an 8×8 magic square is given below. In the finished square each of four quadrants are pan-magic squares as well, each quadrant with same magic constant 130. {{col-begin|width=auto;margin:0.5em auto}} {{col-break|valign=bottom}} {| class="wikitable" style="margin-left:auto;margin-right:auto;text-align:center;width:16em;height:16em;table-layout:fixed;" |- | 0 || 48 || 56 || 8 || 16 || 32 || 40 || 24 |- | 56 || 8 || 0 || 48 || 40 || 24 || 16 || 32 |- | 0 || 48 || 56 || 8 || 16 || 32 || 40 || 24 |- | 56 || 8 || 0 || 48 || 40 || 24 || 16 || 32 |- | 48 || 0 || 8 || 56 || 32 || 16 || 24 || 40 |- | 8 || 56 || 48 || 0 || 24 || 40 || 32 || 16 |- | 48 || 0 || 8 || 56 || 32 || 16 || 24 || 40 |- | 8 || 56 || 48 || 0 || 24 || 40 || 32 || 16 |} {{col-break|valign=bottom|gap=1em}} {| class="wikitable" style="margin-left:auto;margin-right:auto;text-align:center;width:16em;height:16em;table-layout:fixed;" |- | 1 || 8 || 1 || 8 || 7 || 2 || 7 || 2 |- | 7 || 2 || 7 || 2 || 1 || 8 || 1 || 8 |- | 8 || 1 || 8 || 1 || 2 || 7 || 2 || 7 |- | 2 || 7 || 2 || 7 || 8 || 1 || 8 || 1 |- | 3 || 6 || 3 || 6 || 5 || 4 || 5 || 4 |- | 5 || 4 || 5 || 4 || 3 || 6 || 3 || 6 |- | 6 || 3 || 6 || 3 || 4 || 5 || 4 || 5 |- | 4 || 5 || 4 || 5 || 6 || 3 || 6 || 3 |} {{col-break|valign=bottom|gap=1em}} {| class="wikitable" style="margin-left:auto;margin-right:auto;text-align:center;width:16em;height:16em;table-layout:fixed;" |- | style="background-color: silver;"|1 || style="background-color: silver;"|56 || style="background-color: silver;"|57 || style="background-color: silver;"|16 || 23 || 34 || 47 || 26 |- | style="background-color: silver;"|63 || style="background-color: silver;"|10 || style="background-color: silver;"|7 || style="background-color: silver;"|50 || 41 || 32 || 17 || 40 |- | style="background-color: silver;"|8 || style="background-color: silver;"|49 || style="background-color: silver;"|64 || style="background-color: silver;"|9 || 18 || 39 || 42 || 31 |- | style="background-color: silver;"|58 || style="background-color: silver;"|15 || style="background-color: silver;"|2 || style="background-color: silver;"|55 || 48 || 25 || 24 || 33 |- | 51 || 6 || 11 || 62 || style="background-color: silver;"|37 || style="background-color: silver;"|20 || style="background-color: silver;"|29 || style="background-color: silver;"|44 |- | 13 || 60 || 53 || 4 || style="background-color: silver;"|27 || style="background-color: silver;"|46 || style="background-color: silver;"|35 || style="background-color: silver;"|22 |- | 54 || 3 || 14 || 59 || style="background-color: silver;"|36 || style="background-color: silver;"|21 || style="background-color: silver;"|28 || style="background-color: silver;"|45 |- | 12 || 61 || 52 || 5 || style="background-color: silver;"|30 || style="background-color: silver;"|43 || style="background-color: silver;"|38 || style="background-color: silver;"|19 |} {{col-end}}
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)