us ing each of the digits 1 to 9 once only, write one digit in each square so that each line vertically, horizontally and diagonally has the same total. thanks

How about

8...1...6

3...5...7

4...9...2

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.