40 CHAPTER 5 Number Theory EXTENSION FIGURE 9 8 3 4 1 5 9 6 7 FIGURE 10 Magic Squares Legend has it that in about 00 BC the Chinese Emperor Yu discovered on the bank of the Yellow River a tortoise whose shell bore the diagram in Figure 9 This so-called lo-shu is an early example of a magic square If the numbers of dots are counted and arranged in a square fashion, the array in Figure 10 is obtained A magic square is a square array of numbers with the property that the sum along each row, column, and diagonal is the same This common value is called the magic sum The order of a magic square is simply the number of rows (and columns) in the square The magic square of Figure 10 is an order 3 magic square By using the formula for the sum of the first n terms of an arithmetic sequence, it can be shown that if a magic square of order n has entries 1,, 3,, n, then the sum of all entries in the square is n n 1 Since there are n rows (and columns), the magic sum of the square may be found by dividing the above expression by n This results in the following rule for finding the magic sum Magic Sum Formula If a magic square of order n has entries 1,, 3,, n, then the magic sum MS is given by the formula MS n n 1 With n 3 in this formula we find that the magic sum of the square in Figure 10, which may be verified by direct addition, is MS 3 3 1 15 Consider blocked FIGURE 11 There is a method of constructing an odd-order magic square which is attributed to an early French envoy, de la Loubere, that is sometimes referred to as the staircase method The method is described below for an order 5 square, with entries 1,, 3,, 5 Begin by sketching a square divided into 5 cells into which the numbers 1 5 are to be entered Proceed as described below, referring to Figures 11 and 1 for clarification 1 Write 1 in the middle cell of the top row Always try to enter numbers in sequence in the cells by moving diagonally from lower left to upper right There are two exceptions to this: (a) If you go outside of the magic square, move all the way across the row or column to enter the number Then proceed to move diagonally
Extension Magic Squares 41 18 5 9 16 17 4 1 8 15 17 3 5 7 14 16 3 4 6 13 0 4 10 1 19 1 3 10 11 18 5 9 (b) If you run into a cell which is already occupied (that is, you are blocked ), drop down one cell from the last entry written and enter the next number there Then proceed to move diagonally 3 Your last entry, 5, will be in the middle cell of the bottom row Figure 1 shows the completed magic square Its magic sum is 65 FIGURE 1 Benjamin Franklin admitted that he would amuse himself while in the Pennsylvania Assembly with magic squares or circles or any thing to avoid Weariness He wrote about the usefulness of mathematics in the Gazette in 1735, saying that no employment can be managed without arithmetic, no mechanical invention without geometry He also thought that mathematical demonstrations are better than academic logic for training the mind to reason with exactness and distinguish truth from falsity even outside of mathematics The square shown here is one developed by Franklin It has a sum of 056 in each row and diagonal, and, in Franklin s words, has the additional property that a four-square hole being cut in a piece of paper of such size as to take in and show through it just 16 of the little squares, when laid on the greater square, the sum of the 16 numbers so appearing through the hole, wherever it was placed on the greater square should likewise make 056 He claimed that it was the most magically magic square ever made by any magician You might wish to verify the following property of this magic square: The sum of any four numbers that are opposite each other and at equal distances from the center is 514 (which is one-fourth of the magic sum) EXTENSION EXERCISES Given a magic square, other magic squares may be obtained by rotating the given one For example, starting with the magic square in Figure 10, a 90 rotation in a clockwise direction gives the magic square shown here 6 7 1 5 9 8 3 4 Start with Figure 10 and give the magic square obtained by each rotation described 1 180 in a clockwise direction 90 in a counterclockwise direction Start with Figure 1 and give the magic square obtained by each rotation described 3 90 in a clockwise direction 4 180 in a clockwise direction 5 90 in a counterclockwise direction 6 Try to construct an order magic square containing the entries 1,, 3, 4 What happens? Given a magic square, other magic squares may be obtained by adding or subtracting a constant value to or from each entry, multiplying each entry by a constant value, or dividing each entry by a nonzero constant value In Exercises 7 10, start with the magic square whose figure number is indicated, and perform the operation described to find a new magic square Give the new magic sum 7 Figure 10, multiply by 3 8 Figure 10, add 7 9 Figure 1, divide by 10 Figure 1, subtract 10 (continued)
4 CHAPTER 5 Number Theory According to a fanciful story by Charles Trigg in Mathematics Magazine (September 1976, page 1), the Emperor Charlemagne (74 814) ordered a fivesided fort to be built at an important point in his kingdom As good-luck charms, he had magic squares placed on all five sides of the fort He had one restriction for these magic squares: all the numbers in them must be prime The magic squares are given in Exercises 11 15, with one missing entry Find the missing entry in each square 11 1 71 57 389 7 19 0 3 0 (a) 4 11 (b) 14 1 18 10 9 1 13 (c) 17 16 8 5 1 (d) (e) (f) (g) (h) 3 36 35 31 4 10 1 (a) 6 7 7 1 13 17 14 (b) 16 (c) 3 (d) 18 15 8 30 8 (e) 5 9 (f) 1 3 5 6 34 47 69 491 81 467 59 13 14 389 7 191 107 69 431 311 347 149 401 7 179 1 Use the staircase method to construct a magic square of order 7, containing the entries 1,, 3,, 49 The magic square shown in the photograph is from a woodcut by Albrecht Dürer entitled Melancholia 71 69 47 69 491 347 311 149 359 137 15 401 57 149 17 51 389 81 137 The two numbers in the center of the bottom row give 1514, the year the woodcut was created Refer to this magic square to answer Exercises 30 16 3 13 16 Compare the magic sums in Exercises 11 15 Charlemagne had stipulated that each magic sum should be the year in which the fort was built What was that year? Find the missing entries in each magic square 17 18 75 68 (a) (b) 7 (c) 71 76 (d) 1 8 13 (a) (b) 14 7 16 9 4 (c) (d) (e) (f) 15 5 10 11 8 9 6 7 1 4 15 14 1 Durer s Magic Square What is the magic sum? 3 Verify: The sum of the entries in the four corners is equal to the magic sum 4 Verify: The sum of the entries in any by square at a corner of the given magic square is equal to the magic sum
Extension Magic Squares 43 5 Verify: The sum of the entries in the diagonals is equal to the sum of the entries not in the diagonals 6 Verify: The sum of the squares of the entries in the diagonals is equal to the sum of the squares of the entries not in the diagonals 7 Verify: The sum of the cubes of the entries in the diagonals is equal to the sum of the cubes of the entries not in the diagonals 8 Verify: The sum of the squares of the entries in the top two rows is equal to the sum of the squares of the entries in the bottom two rows 9 Verify: The sum of the squares of the entries in the first and third rows is equal to the sum of the squares of the entries in the second and fourth rows 30 Find another interesting property of Dürer s magic square and state it 31 A magic square of order 4 may be constructed as follows Lightly sketch in the diagonals of the blank magic square Beginning at the upper left, move across each row from left to right, counting the cells as you go along If the cell is on a diagonal, count it but do not enter its number If it is not on a diagonal, enter its number When this is completed, reverse the procedure, beginning at the bottom right and moving across from right to left As you count the cells, enter the number if the cell is not occupied If it is already occupied, count it but do not enter its number You should obtain a magic square similar to the one given for Exercises 30 How do they differ? With chosen values for a, b, and c, an order 3 magic square can be constructed by substituting these values in the generalized form shown here a + b a b c a + c 35 It can be shown that if an order n magic square has least entry k, and its entries are consecutive counting numbers, then its magic sum is given by the formula MS n k n 1 Construct an order 7 magic square whose least entry is 10 using the staircase method What is its magic sum? 36 Use the formula of Exercise 35 to find the missing entries in the following order 4 magic square whose least entry is 4 (a) 38 37 7 35 (b) 30 3 31 33 (c) 8 (d) 6 5 (e) In a 1769 letter from Benjamin Franklin to a Mr Peter Collinson, Franklin exhibited the following magic square of order 8 5 61 4 13 0 9 14 3 6 51 46 35 53 60 5 1 1 8 11 6 59 54 43 38 55 58 7 10 3 6 9 8 57 56 41 40 36 30 37 7 39 5 50 63 15 18 31 34 45 19 44 4 4 47 16 1 64 49 48 33 3 17 37 What is the magic sum? a b + c a a + b c a c a + b + c a b Use the given values of a, b, and c to construct an order 3 magic square, using this generalized form 3 a 5, 33 a 16, 34 a 5, b 1, b, b 4, c 3 c 6 c 8 Verify the following properties of this magic square 38 The sums in the first half of each row and the second half of each row are both equal to half the magic sum 39 The four corner entries added to the four center entries is equal to the magic sum 40 The bent diagonals consisting of eight entries, going up four entries from left to right and down four entries from left to right, give the magic sum (For example, starting with 16, one bent diagonal sum is 16 63 57 10 3 40 34 17) (continued)
44 CHAPTER 5 Number Theory If we use a knight s move (up two, right one) from chess, a variation of the staircase method gives rise to the magic square shown here (When blocked, we move to the cell just below the previous entry) 10 18 1 14 11 4 7 0 3 17 5 13 1 9 3 6 19 15 4 1 5 8 16 Use a similar process to construct an order 5 magic square, starting with 1 in the cell described 41 fourth row, second column (up two, right one; when blocked, move to the cell just below the previous entry) 4 third row, third column (up one, right two; when blocked, move to the cell just to the left of the previous entry)