Posted by Gray on Tuesday, October 23, 2007 at 9:55am.
8 1 6
3 5 7
4 9 2
all the rows, columns, and diagonals add up to 15
I have a pattern for any square of odd sides
8 1 6
3 5 7
4 9 2
4 3 8
9 5 1
2 7 6
2 9 4
7 5 3
6 1 8
6 7 2
1 5 9
8 3 4
6 1 8
7 5 3
2 9 4
2 7 2
9 5 1
4 3 8
Of course these are simply rotations and mirror images of the basic 3 cell magic square. How many others can you find?
In general:
MAGIC SQUARES
Magic squares, those seemingly innocent looking collections of numbers that have fascinated so many for centuries, were known to the ancients, and were thought to possess mystical qualities and magical powers because of their unusual nature. In reality, they are nor=t as magic as they are fascinating since they are usually created by following a specific set of rules or guidelines. Their creation has been a constant source of amusement for many over the years as well as studying them for their seemingly mystical properties. History records their presence in China prior to the Christian era and their introduction into Europe is believed to have occurred in the 15th century. The study of the mathematical theory behind them was initiated in France in the 17th century and subsequently explored in many other countries.
Most people are quite familiar with the basic, and traditional, magic square where the sum of each row, column, and main diagonals, add up to a constant. The basic magic square of order n, that is n rows and n columns, or an n x n array, uses the integers from 1 to n^2. A magic square is usually referred to as a 3 cell, 4 cell, 5 cell, etc., or as a 3x3 array, 4x4 array, 5x5 array, etc. The basic square is made up of the consecutive integers from 1 to n^2 with all rows, columns, and long diagonals adding up to a constant C that is defined by
C = n(n^2 + 1)/2
The integers do not have to start with one nor do they have to be truly consecutive. A magic square can start with any number and the difference between the successive set of numbers can be any common difference, that is, in arithmetic series. For instance, it could start with 15 and progress with a common difference between successive numbers of say 3. The new constant C for this type of magic square can be derived from
C = n[2A + D(n^2 - 1)]/2
where A is the starting integer, D is the common difference between successive terms, and n is as defined earlier.
Obviously, an infinite number of squares can be made using these open boundries and rules. Consider also the squares that can be created by rotating and reflecting the basic squares and those not starting with 1. Considering only the basic squares starting with 1, there is only one 3rd order magic square. There are 880 different 4th order basic squares and approximately 320,000,000 different 5th order basic squares. Wow!
Would you believe that it is possible to create a magic square where every row, column, and main diagonal, add up to a different number?
There are many other types of magic squares. A magic square where one, or both, of the main diagonal sums is different from the rectangular sums, is called a semi-magic square. Squares where all the diagonal sums are equal to the all the rectangular sums are called panmagic squares. A square created by replacing each of its numbers by its square is referred to as bimagic while one created by replacing each of its numbers by its cubes is called trimagic.
There are an unlimited number of orders for squares, hundreds of different methods of forming squares, and countless rotations and reflections of the squares. There are odd and even order squares, doubly even squares, bordered squares, symmetrical squares, pandiagonal squares, non-consecutive squares, trebly magic squares, etc., all created by Strachey's rule, De la Loubere's rule, Arnoux's rule, Margossian's method, Plank's method, Kraitchik's method, Heath's method, etc., and the list goes on and on. Only the simplest are discussed below.
ODD CELL SQUARES
The simplest magic square has 3 cells on a side, or 9 cells altogether. We call this a three square. The simplest three square is one where you place the numbers from 1 to 9, inclusive, in each cell in such a way that the sum of every horizontal and vertical row as well as the two diagonal rows add up to the same number. This basic square looks like the following:
8 1 6
3 5 7
4 9 2
As it turns out the rows all add up to 15. Other three cell magic squares can be created where the rows all add up to other numbers, the only constraint being that the sums of the rows must be divisible by 3. For instance, a magic square adding up to 42 would look like this:
17 10 15 22 8 18
12 14 16 12 16 20
13 18 11 14 24 10
While we have only looked at three cell magic squares so far, you might have noticed a couple of things that turn out to be fundamental to all odd cell magic squares. First, the center square number is the middle number of the group of numbers being used or the sum of the first number and the last number divided by 2; it is also equal to the row total divided by the number of cells in the square.
Your next logical question is bound to be,"How does one create such squares? Well, I will try to explain it in words without a picture.
First draw yourself a three cell square with a dark pencil and place the numbers 1 through 9 in them as shown above. Now, above squares 1 and 6 draw two light lined squares just for reference. Similarly, draw two light lined squares to the right of squares 6 and 7. Their use will become obvious as we go along. Always place the first number being used in your square in the top center square, number one in our illustration. Now comes the tricky part. We now wish to locate the number 2 in its proper location. Move out of the number 1 box, upward to the right, at a 45 degree angle, into the light lined box. Clearly this imaginary box is outside the boundries of our three cell square. What you do is drop down to the lowest cell in that column and place the 2. Now for the 3, move upward to the right again into the light lined box next to the number 7. Again you are outside the three cell square so move all the way over to the left in that row and place the 3. Now you will notice that you cannot move upward to the right as you are blocked by the number 1. Merely drop down one row and place the 4 directly below the 3. Move upward to the right and place the 5. Again, move upward to the right and place the 6. You now cannot move upward to the right as there is no imaginary square there for you to move into. Merely drop down one cell and place the 7 directly below the 6. Now move upward and to the right again and you are outside the square again. As before, merely move all the way over to the left cell in that row and place the 8. Moving upward and to the right again, you are outside the square again so merely drop down to the bottom cell in that column and place the 9. This exact same pattern is followed no matter what the rows and columns add up to.
You can also enter the numbers starting in the center box of the right column, the center box of the bottom row, or the center box of the left column as long as you follow the same pattern of locating numbers. If you were to do this you would end up with the following squares:
4 3 8.........2 9 4..........6 7 2
9 5 1.........7 5 3..........1 5 9
3 7 6.........6 1 8..........8 3 4
Moving all the outer numbers one or more boxes clockwise, or counterclockwise, also produces the same result.
Your next question is bound to be, "How does one create a magic 3 square that adds up to something other than 15?" There are two ways to create magic square for your friends. First, ask them for a number, say no more than 2 digits. You then proceed to place their number in the top center cell and continue to fill in the square, in the same basic pattern we just described above, telling them that when you are done, the rows, columns, and diagonals will all add up to a specific number.
The second way to create a magic square is to ask them for a number larger than 15 that is divisible by three. You then proceed to fill in all the cells in the same pattern such that the rows, columns, and diagonals add up to the number they gave you. Here is how you do it.
In the first method, ask them for a number, say from 1 to 25, but it can be any number. Lets say they give you 17. In your head, multiply 17 times 3 and add 12, such that 3(17) + 12 = 63. You now place the number 17 in the top center cell, continue to place 18, 19, 20, 21, 22, 23, 24, and 25 in the the cells in the same pattern as you placed the numbers 1 through 9 above. As you are doing this, you tell them that when you are done, every row, column, and the two diagonals will add up to 63. What magic.
24 17 22
19 21 23
20 25 18
For the second method, ask them for a number that is divisible by three as you are working with a 3 x 3 square. Lets say they give you 48. In you head now, subtract 12 from the number they give you and divide the result by 3. For our example you will get 12. So place the number 12 in the top center cell and continue to fill in the other
cells in the same pattern until you reach the last cell with the number 20. Lo and behold, every row, column, and the diagonals, add up to 48.
19 12 17
14 16 18
15 20 13
You now have all the information required to create any three cell magic square possible. If anyone asks you why you use the same pattern for placing the numbers in the cells every time, fool them by rotating the pattern 90 degrees, then 180 degrees and finally 270 degrees if they really get suspicious. What this means is, for
instance, you can place the starting number in the center cell of the right most column, and so on, as I described above, and then work the same pattern starting from there. Similarly for the 180 and 270 degree rotations.
By the way, the method described above for filling in the cells is applicable to any odd cell magic square, i.e., 5, 7, etc., cell squares. The first number always goes in the top center cell. The formula for the 5 cell square is Sum = 5X + 60 where X is the number you receive from the person. If they are giving you the sum number, it must be divisible by 5 and then you subtract 60 and divide the result by 5 to get the starting number. For the 7
cell square the formula is Sum = 7X + 168. If giving you the sum number, it must be divisible by 7 and you then subtract 168 and divide the result by 7 to get the starting number. I'll leave it for you to get any others you might
be interested in from your library. The 5 cell square looks like the following:
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
Note that the middle number is mid way between the 1 and 25 and that the middle number is 1/5th of the row total of 65.
I'll leave the 7 cell square for you to experiment with.
A more general allocation of numbers to the cells is given by the following, given the nine numbers with n being the middle number of the nine numbers.
n + 3 n - 4 n + 1 Magic squares, those seemingly innocent looking collections of numbers that have fascinated so many for centuries, were known to the ancients, and were thought to possess mystical qualities and magical powers because of their unusual nature. In reality, they are not as magic as they are fascinating since they are usually created by following a specific set of rules or guidelines. Their creation has been a constant source of amusement for many over the years as well as studying them for their seemingly mystical properties. History records their presence in China prior to the Christian era and their introduction into Europe is believed to have occurred in the 15th century. The study of the mathematical theory behind them was initiated in France in the 17th century and subsequently explored in many other countries. The most thorough treatment of the subject may be found in the easily understood book Magic Squares and Cubes by W.S. Andrews, now published by
Dover Publications, Inc., originally published by Open Court Publishing Company in 1907. It represents the outgrowth of the famous sympoium on magic squares conducted in the Monist magazine from 1905 to 1916. It is still considered the best connected, thorough, and non-technical description and analysis of the various kinds of magic squares.
Most people are quite familiar with the most basic, and traditional, magic square where the sum of every row, every column, and the two main diagonals, all add up to a constant C. A magic square is usually referred to as a 3 cell, 4 cell, 5 cell, etc., or as a 3x3 array, 4x4 array, 5x5 array, etc. The most basic magic square of order n,
that is, n rows and n columns, or an n x n array, uses the consecutive integers from 1 to n^2. The constant sum, C, is defined by
C = n(n^2 + 1)/2
The integers do not have to start with one nor do they have to be truly consecutive. A magic square can start with any number you wish and the difference between the successive set of numbers can be any common difference, that is, in arithmetic series. For instance, it could start with 15 and progress with a common difference between successive numbers of say 3. The new constant C for this type of magic square can be derived from
C = n[2A + D(n^2 - 1)]/2
where A is the starting integer, D is the common difference between successive terms, and n is as defined earlier.
The difference between the integers may be varied also but only between, and within, each set of n digits. By that, I mean, the series of digits can have a common difference within each set of 3 digits, and another difference between each set of 3. The only requirement that must be met is that the sum of all n^2 digits must be divisible by n^2.
Lets look at a sample series starting with 3. You could have a series such as 3-6-9-15-18-21-27-30-33. The differences between each pair in each set of three digits is 3 with the difference between the two sets of three digits being 6. Thus,
Digits.............3----6----9----15----18----21----27----30----33
Differences........3....3....6......3......3.....6......3......3
The sum of the digits is 162, the row sums being 162/3 = 54. This square would look like the following:
30.....3....21
.9....18....27
15....33.....6
The middle number is also the sum of the digits divided by n^2, in this case 162/9 = 18.
Some interesting characteristics of odd cell squares are:
1--The middle number of the series of numbers always goes in the middle cell.
2--The middle number is always the sum of the digits divided by n^2, or the sum of the first and last digits divided by 2, or the row sum divided by 3.
3--Any two numbers diametrically equidistant from the center add up to 2 times the center number.
ODD CELL SQUARES
Before getting into the mechanical or systematic methods of creating magic squares, let me first show you that it is possible to create one by means of simple logic, although probably only for the 3 cell square.
The usual 3 cell magic square problem is posed as, "Place the numbers 1 through 9 in the 9 cells of the 3x3 square such that each row, each column, and each diagonal add up to the same total."
Of course, the typical trial and error approach will ultimately get you to an answer but the more rewarding method is your own intuition and logic. Lets see where this takes us.
The first thing you might ask yourself is what is the total that we are seeking with the 9 digits. Since all three rows or columns must add up to the same total, it stands to reason that the sum of the rows or columns must, by definition, add up to the sum of the 9 digits, which turns out to be 45. Therefore, each row or column must add up to 45/3 = 15.
You might notice that 8 of the digits we are using just happen to add up to 10, 1+9, 2+8, 3+7, and 4+6. It might also occur to you that the middle number of the 9 digits, the 5, would most logically want to be in the middle cell with the others located around it all adding up to 15. Where to start?
What if the 9 were located on a corner? Since all three lines of numbers, including that corner 9, must toal 15, we would need three pairs of numbers that each add up to 6. Of course, this is impossible as we only have 1+5 and 2+4 at our disposal thus forcing the 9 to be located in the middle cell of one of the sides. Lets try the middle
cell of the bottom row (it could be any of the four available positions) which forces the 1 to be in the middle cell of the top row.
.................................? 1 ?
.................................? 5 ?
.................................? 9 ?
Looking at our bottom row now, we notice that the two outer numbers must add up to 6 and we only have 2+4 available to us. For a reason that will become obvious later, lets try the 2 in the lower right hand corner and the 4 in the lower left hand corner.
.................................? 1 ?
.................................? 5 ?
.................................4 9 2
What do you know? It looks like our intuition can take a rest now as the other seem to all just fall into place. The upper left cell must be an 8, the upper right must be a 6, and of course, the middle left is forced to be a 3 and the middle right becomes the 7. Here we are, and just by thinking it through.
.................................8 1 6
.................................3 5 7
.................................4 9 2
Note that the outer numbers can be rotated clockwise or counterclocwise to define 7 additional arrangements. Mirror imaging about both vertical and horizontal axes as well as the diagonal axes will produce more. See how many different ones you can define overall.
Now we will get back to the more traditional method.
The simplest magic square has 3 cells on a side, or 9 cells altogether. We call this a three square. The simplest three square is one where you place the numbers from 1 to 9, inclusive, in each cell in such a way that the sum of every horizontal and vertical row as well as the two diagonal rows add up to the same number. This basic 3 cell square, adding up to 15, looks like the following (looks familiar):
8 1 6
3 5 7
4 9 2
This 3 cell square has some other strange characteristics. All of the four lines that pass through the center are in arithmetic progressionhaving differences of 1, 2, 3, and 4. Notice also that the squares of the first and third columns are equal, i.e., 8^2 + 3^2 + 4^2 = 6^2 + 7^2 + 2^2 = 89. The sum of the middle column squares is 1^2 + 5^2 + 9^2 = 107 which is equal to 89 + 18. The sum of the squares in the rows total 101, and 83 and, strangely enough, 101 - 83 = 18.
Other three cell magic squares can be created where the rows all add up to other numbers, the only constraint being that the sums of the rows must be divisible by 3. For instance, magics square adding up to 42 and 48 would look like this:
17 10 15 22 8 18
12 14 16 12 16 20
13 18 11 14 24 10
While we have only looked at three cell magic squares so far, you might have noticed a couple of things that turn out to be fundamental to all odd cell magic squares. First, the center square number is the middle number of the group of numbers being used or the sum of the first number and the last number divided by 2; it is also equal to the row total divided by the number of cells in the square.
Your next logical question is bound to be,"How does one create such squares? Well, I will try to explain it in words without a picture.
First draw yourself a three cell square with a dark pencil and place the numbers 1 through 9 in them as shown above. Now, above squares 1 and 6 draw two light lined squares just for reference. Similarly, draw two light lined squares to the right of squares 6 and 7. Their use will become obvious as we go along. Always place the first number being used in your square in the top center square, number one in our illustration. Now comes the tricky
part. We now wish to locate the number 2 in its proper location. Move out of the number 1 box, upward to the right, at a 45 degree angle, into the light lined box. Clearly this imaginary box is outside the boundries of our three cell square. What you do is drop down to the lowest cell in that column and place the 2. Now for the 3, move upward to the right again into the light lined box next to the number 7. Again you are outside the three cell square
so move all the way over to the left in that row and place the 3. Now you will notice that you cannot move upward to the right as you are blocked by the number 1. Merely drop down one row and place the 4 directly below the 3. Move upward to the right and place the 5. Again, move upward to the right and place the 6. You now cannot move upward to the right as there is no imaginary square there for you to move into. Merely drop down one cell and place
the 7 directly below the 6. Now move upward and to the right again and you are outside the square again. As before, merely move all the way over to the left cell in that row and place the 8. Moving upward and to the right again, you are outside the square again so merely drop down to the bottom cell in that column and place the 9. This exact same pattern is followed no matter what the rows and columns add up to.
You can also enter the numbers starting in the center box of the right column, the center box of the bottom row, or the center box of the left column as long as you follow the same pattern of locating numbers. If you were to do this you would end up with the following squares:
4 3 8.........2 9 4..........6 7 2
9 5 1.........7 5 3..........1 5 9
2 7 6.........6 1 8..........8 3 4
Moving all the outer numbers one or more boxes clockwise, or counterclockwise, also produces the same result.
Your next question is bound to be, "How does one create a magic 3 square that adds up to something other than 15?" There are two ways to create magic square for your friends. First, ask them for a number, say no more than 2 digits. You then proceed to place their number in the top center cell and continue to fill in the square, in the same basic pattern we just described above, telling them that when you are done, the rows, columns, and diagonals will all add up to a specific number.
The second way to create a magic square is to ask them for a number larger than 15 that is divisible by three. You then proceed to fill in all the cells in the same pattern such that the rows, columns, and diagonals add up to the number they gave you. Here is how you do it.
In the first method, ask them for a number, say from 1 to 25, but it can be any number. Lets say they give you 17. In your head, multiply 17 times 3 and add 12, such that 3(17) + 12 = 63. You now place the number 17 in the top center cell, continue to place 18, 19, 20, 21, 22, 23, 24, and 25 in the the cells in the same pattern as you placed the numbers 1 through 9 above. As you are doing this, you tell them that when you are done, every row, column, and the two diagonals will add up to 63. What magic.
24 17 22
19 21 23
20 25 18
n - 2 n n + 2
n - 1 n + 4 n - 3
I hope this information has been of some interest to you and that you will enjoy mystifying your friends with your magical abilities. If you have an interest in Magic Squares, I heartily recommend the references listed below.
1-- Math-E-Magic by Royal Vale Heath, Dover Publications, Inc., 1953. I believe it is still in publication.
2-- Mathematical Recreations and Essays by W.W. Rouse Ball and H.S.M. Coxeter, Dover Publications, Inc., 1987.
3-- Amusements in Mathematics by H.E. Dudeney, Dover Publications, Inc., 1970.
4-- The Moscow Puzzles by Boris A. Kordemsky, Dover Publications, Inc., 1992.
5-- 536 Curious Problems & Puzzles by Martin Gardner, Barnes & Noble Books, 1995.
6-- Madachy's Mathematical Recreations by Joseph S. Madachy, Dover Publications, Inc., 1979.
7-- Mathematical Recreations by Maurice Kraitchik, Dover Publications, Inc., 1942.
8-- Magic Squares and Cubes by W.S. Andrews, Dover Publications, Inc., 1960 (first published in 1917).
9--The Zen of Magic Squares, Circles and Stars,by Clifford A. Pickover, Dover Publications, Inc., 2002
..........................................................................ENJOY................................................................................