Euler's Formulas for 3x3 Magic Squares of 6 Squares
by Lee Morgenstern, December 2011.

Euler wrote several papers about magic squares. He also derived several generating formulas for 3x3 magic squares of 6 squares (although in a disguised form). The generating formulas produce some, but not all solutions.

For each solution, there are several ways of putting them into a magic square and then testing for a 7th square.

You can potentially find 100-digit solutions with these formulas in a reasonable amount of time.

E806 contains fragments from Euler's notebooks. Sections 58, 59, and 60 have formulas that produce two 3-square arithmetic progressions having the same step value.

pp + qq = 2yy
rr + ss = 2xx
pp - qq = rr - ss

Rearrange the entries of a 3x3 magic square to expose the arithmetic progressions.

c+a  c-a-b  c+b               c-a-b  c-b  c-b+a
c-a+b   c   c-b+a    ---->      c-a    c    c+a
c-b  c+a+b  c-a               c-a+b  c+b  c+a+b

The three rows, the three columns, and the two diagonals are all 3-square arithmetic progressions.  Note that the row AP's all have the same step value.

We can put two 3-square arithmetic progressions having the same step value in three different row combinations.

Thus there are 9 different values to test for a 7th square for each of Euler's generated 6-square solutions.

pp  yy  qq       pp  yy  qq        --  --  --
rr  xx  ss       --  --  --        pp  yy  qq
--  --  --       rr  xx  ss        rr  xx  ss

The other 9 entries can be computed as follows.

(2rr-pp)         (rr+pp)/2         (2pp-rr)
(2xx-yy)         (xx+yy)/2         (2yy-xx)
(2ss-qq)         (ss+qq)/2         (2qq-ss)

E796 contains generating formulas for the problem of finding three squares such that the sum of each two equals twice a square. Thus we need to find 6 squares that satisfy the following conditions.

pp + qq = 2zz
pp + rr = 2yy
qq + rr = 2xx

There are three ways of assigning the six squares to the entries of the magic square. Thus there are 9 different values to test for a 7th square for each of Euler's generated 6-square solutions.

c-a-b  c-b  c-b+a
c-a    c    c+a
c-a+b  c+b  c+a+b

pp  zz  qq       qq  xx  rr       rr  yy  pp
yy  xx  --       zz  yy  --       xx  zz  --
rr  --  --       pp  --  --       qq  --  --

The other 9 entries can be computed as follows.

(xx-zz+qq)       (yy-xx+rr)       (qq-xx+zz)
(rr-yy+xx)       (pp-zz+yy)       (xx-rr+pp)
(rr-pp+qq)       (pp-qq+rr)       (qq-rr+pp)

Rotating and reflecting the configuration does not produce any new entry values.

E797 concerns finding four values A,B,C,D satisfying the following conditions.

A+B = pp
A+C = qq
A+D = B+C = rr
B+D = ss
C+D = tt
A < B < C < D

This is equivalent to finding a 3x3 magic square having 5 square entries as follows.

c+a  c-a-b  c+b         C+D   2A  B+D        tt -- ss
c-a+b   c   c-b+a  --->   2B  A+D   2C  --->  -- rr --
c-b  c+a+b  c-a         A+C   2D  A+B        qq -- pp

You can safely ignore this paper because my 5-square solution is better and can be used in any arrangement to produce any 7-square solution.