# Magic Squares of Squares

People have been toying with magic squares for more than 2,000 years—setting themselves increasingly difficult challenges to find arrays of numbers that fit given patterns.

Typically, a magic square consists of a set of distinct integers arranged in the form of a square so that the numbers in each row, column, and diagonal all add up to the same total. The most recent developments concern magic squares in which each of the entries is a different squared number—a magic square of squares.

In the current *Mathematical Intelligencer*, Christian Boyer of Enghien les Bains, France, summarizes progress in finding magic squares of squares and lists several unsolved problems involving such patterns. In one case, he offers a cash (and champagne) prize for the solution.

The first known magic square of squares was devised by Leonhard Euler (1707–1783). He described this four-by-four array in a letter he sent in 1770 to Joseph-Louis Lagrange (1736–1813).

68 ^{2} | 29 ^{2} | 41 ^{2} | 37 ^{2} |

17 ^{2} | 31 ^{2} | 79 ^{2} | 32 ^{2} |

59 ^{2} | 28 ^{2} | 23 ^{2} | 61 ^{2} |

11 ^{2} | 77 ^{2} | 8 ^{2} | 49 ^{2} |

In Euler's magic square of squares (above), the four rows, four columns, and two diagonals each have the sum 8515.

In a separate publication, Euler revealed the formula that he had used to come up with this pattern—one member of a family of magic squares of squares.

(+ ap+bq+cr+ds)² | (+ ar–bs–cp+dq)² | (– as–br+cq+dp)² | (+ aq–bp+cs–dr)² |

(– aq+bp+cs–dr)² | (+ as+br+cq+dp)² | (+ ar–bs+cp–dq)² | (+ ap+bq–cr–ds)² |

(+ ar+bs–cp–dq)² | (– ap+bq–cr+ds)² | (+ aq+bp+cs+dr)² | (+ as–br–cq+dp)² |

(– as+br–cq+dp)² | (– aq–bp+cs+dr)² | (– ap+bq+cr–ds)² | (+ ar+bs+cp+dq)² |

The magic sum is given by (*a*² + *b*² + *c*²

+ *d*²)(*p*² + *q*² + *r*² +

*s*²).

Two additional conditions are needed to get the diagonals to add up to the same sum:

*pr*+*qs*= 0,*a*/*c*= [–*d*(*pq*+*rs*) –*b*(*ps*+*qr*)]/[*b*(*pq*+*rs*)+

*d*(*ps*+*qr*)].

To get the magic square that he sent to Lagrange, Euler set *a* = 5,

*b* = 5, *c* = 9, *d* = 0, *p* = 6, *q* =

4, *r* = 2, *s* = –3.

The smallest magic square of squares belonging to this family (below) is not one found

by Euler himself. It's generated by setting *a* = 2, *b* = 3,

*c* = 5, *d* = 0, *p* = 1, *q* = 2, *r* =

8, *s* = –4. The magic sum is 3230.

48 ^{2} | 23 ^{2} | 6 ^{2} | 19 ^{2} |

21 ^{2} | 26 ^{2} | 33 ^{2} | 32 ^{2} |

1 ^{2} | 36 ^{2} | 13 ^{2} | 42 ^{2} |

22 ^{2} | 27 ^{2} | 44 ^{2} | 9 ^{2} |

There are other four-by-four patterns now known that do not belong to Euler's formula family.

Boyer has recently come up with the first examples of five-by-five, six-by-six, and seven-by-seven magic squares of squares.

Here's the smallest five-by-five magic square of squares, with a magic sum of 1375.

1 ^{2} | 2 ^{2} | 31 ^{2} | 3 ^{2} | 20 ^{2} |

22 ^{2} | 16 ^{2} | 13 ^{2} | 5 ^{2} | 21 ^{2} |

11 ^{2} | 23 ^{2} | 10 ^{2} | 24 ^{2} | 7 ^{2} |

12 ^{2} | 15 ^{2} | 9 ^{2} | 27 ^{2} | 14 ^{2} |

25 ^{2} | 19 ^{2} | 8 ^{2} | 6 ^{2} | 17 ^{2} |

Boyer suspects that it's impossible to get a six-by-six magic square using squared consecutive integers (0^{2} to 35^{2} or 1^{2} to 36^{2}). Interestingly, the example that he did find (below) has all the squares from 0^{2} to 36^{2} with the exception of 30^{2}.

2 ^{2} | 1 ^{2} | 36 ^{2} | 5 ^{2} | 0 ^{2} | 35 ^{2} |

6 ^{2} | 33 ^{2} | 20 ^{2} | 29 ^{2} | 4 ^{2} | 13 ^{2} |

25 ^{2} | 7 ^{2} | 14 ^{2} | 24 ^{2} | 31 ^{2} | 12 ^{2} |

21 ^{2} | 32 ^{2} | 11 ^{2} | 15 ^{2} | 22 ^{2} | 16 ^{2} |

34 ^{2} | 18 ^{2} | 23 ^{2} | 10 ^{2} | 19 ^{2} | 9 ^{2} |

17 ^{2} | 8 ^{2} | 3 ^{2} | 28 ^{2} | 27 ^{2} | 26 ^{2} |

Boyer's seven-by-seven magic square of squares with the smallest magic sum (below), however, does use squared consecutive integers.

25 ^{2} | 45 ^{2} | 15 ^{2} | 14 ^{2} | 44 ^{2} | 5 ^{2} | 20 ^{2} |

16 ^{2} | 10 ^{2} | 22 ^{2} | 6 ^{2} | 46 ^{2} | 26 ^{2} | 42 ^{2} |

48 ^{2} | 9 ^{2} | 18 ^{2} | 41 ^{2} | 27 ^{2} | 13 ^{2} | 12 ^{2} |

34 ^{2} | 37 ^{2} | 31 ^{2} | 33 ^{2} | 0 ^{2} | 29 ^{2} | 4 ^{2} |

19 ^{2} | 7 ^{2} | 35 ^{2} | 30 ^{2} | 1 ^{2} | 36 ^{2} | 40 ^{2} |

21 ^{2} | 32 ^{2} | 2 ^{2} | 39 ^{2} | 23 ^{2} | 43 ^{2} | 8 ^{2} |

17 ^{2} | 28 ^{2} | 47 ^{2} | 3 ^{2} | 11 ^{2} | 24 ^{2} | 38 ^{2} |

Is there a three-by-three magic square of squares? No one knows.

In 1996, Martin Gardner offered $100 as a prize to the first person to construct such a square from nine distinct integer squares. No one has yet come forward with an example—or a proof that it's impossible to create one.

Boyer has offered a prize of 100 (and a bottle of champagne) for a solution to a presumably easier problem: finding a new example of a three-by-three magic square with seven squared entries that differs from the one already known or constructing the first example with eight squared entries.

Here's the known example of a three-by-three magic square in which seven of the entries are squared integers, found by Andrew Bremner of Arizona State University (and independently by Lee Sallows of the University of Nijmegen):

373 ^{2} | 289 ^{2} | 565 ^{2} |

360721 | 425 ^{2} | 23 ^{2} |

205 ^{2} | 527 ^{2} | 222121 |

Of course, rotations, symmetries, and multiples of this known square don't count as new solutions.

What is known about any three-by-three magic square of nine squared integers—if it exists—is that the numbers involved would be huge.

Happy hunting!