Counting Franklin’s Magic Squares

“In my younger days, having once some leisure which I still think I might have employed more usefully, I had amused myself in making . . . magic squares,” Benjamin Franklin (1706–1790) wrote in a letter more than 200 years ago.

Typically, a magic square consists of a set of integers arranged in the form of square so that the numbers in each row, column, and diagonal all add up to the same total. If the integers are consecutive numbers from 1 to n2, the square is said to be of nth order. The magic sum itself is given by n(n2 + 1)/2.

Franklin’s letter continues, “I could fill the cells of any magic square, of reasonable size, with a series of numbers as fast as I could write them, disposed in such a manner, as that the sums of every row, horizontal, perpendicular, or diagonal, should be equal; but not being satisfied with these, which I looked on as common and easy things, I had imposed on myself more difficult tasks, and succeeded in making other magic squares, with a variety of properties, and much more curious.”

Franklin’s Autobiography also contains a reference to magic squares. Assembly debates “were often so unentertaining that I was induc’d to amuse myself making magic squares or circles, or any thing to avoid weariness . . .,” Franklin admitted.

If he had wished to, Franklin could have claimed credit for inventing an ingenious variant of the magic square. In his most famous example, Franklin arranged the numbers from 1 to 64 in an 8-by-8 grid, one number per cell, so that the sum of each row and column is 260.

Each half-row and half-column sums to 130, so the square is split vertically or horizontally into two magic rectangles. Various other groupings of cells within the grid, including several V-shaped (bent-diagonal) patterns, also add up to 260 or 130. The main, corner-to-corner diagonals, however, do not add up to the magic number.

52
61
4
13
20
29
36
45
14
3
62
51
46
35
30
19
53
60
5
12
21
28
37
44
11
6
59
54
43
38
27
22
55
58
7
10
23
26
39
42
9
8
57
56
41
40
25
24
50
63
2
15
18
31
34
47
16
1
64
49
48
33
32
17

In Franklin square shown above, various groupings of cells within the grid, including bent diagonals, add up to 260 or 130. For instance, (52 + 3 + 5 + 54) + (10 + 57 + 63 + 16) = 260 = (55 + 6 + 5 + 51) + (46 + 28 + 27 + 42). Note that the sum of the numbers in any 2-by-2 subsquare is 130.

Only three examples of these bent-diagonal squares have been uncovered so far in Franklin’s writings. Now, physicist Peter Loly of the University of Manitoba has determined precisely how many such squares exist: 1,105,920. He used a computer program created by students Daniel Schindel and Matthew Rempel to find the answer, systematically checking all the possible combinations.

“When we started, we didn’t know we could do this,” Loly says. Instead of getting an exact count, the team originally expected nothing better than a statistical estimate of the prevalence of 8th-order Franklin squares.

“To find an exact result in a reasonable time was a very pleasant surprise,” Loly and his team write in an upcoming Proceedings of the Royal Society A: Mathematical, Physical and Engineering Sciences. “Our count of 1,105,920 dramatically increases the handful of known examples and is some eight orders of magnitude less than a recent upper bound.”

In a 2004 paper, mathematician Maya Mohsin Ahmed of the University of California, Davis had worked out that there are no more than about 228 trillion Franklin squares.

In pandiagonal squares, the broken diagonals (parallel to the main diagonal) have the same sum as the main diagonal. Of the 1,105,920 Franklin squares, exactly one-third, 368,640, are pandiagonal and, therefore, fully magic natural Franklin squares.

Here’s an example of one of these new finds.

1
32
38
59
5
28
34
63
46
51
9
24
42
55
13
20
27
6
64
33
31
2
60
37
56
41
19
14
52
45
23
10
11
22
48
49
15
18
44
53
40
57
3
30
36
61
7
26
17
16
54
43
21
12
50
47
62
35
25
8
58
39
29
4

Check out Ivars Peterson’s MathTrek blog at http://blog.sciencenews.org/.