3x3 Magic Square of Squares FormulationsThree-Term FormulationDuplicate EntriesProperties of the EntriesAll Zero or All Non-Zero Theorem All Odd Or All Even Theorem All Triples or All Non-Triples Theorem Multiple of 24 Theorem Central Entry Theorem Non-Central Entry Theorem No 8k+3 Entry Theorem Middle Side Entry Theorem Corner Entry TheoremPythagorean Triangle FormulationMagic Square FormulationsRow Formulation Center FormulationSupporting General FormulasPythagorean Triangle General Formula Arithmetic Progression General FormulaStudies and Curiosities3x3 Magic Square of 7 Squares - Study 1 3x3 Magic Square of 7 Squares - Study 2 3x3 Magic Square of 7 Squares - Study 3 3x3 Magic Square of 8 Squares Construction Formula Euler's 3x3 Magic Square of 7 SquaresThree-Term FormulationSuppose we have a 3x3 magic square. E_{11}E_{12}E_{13}E_{21}E_{22}E_{23}E_{31}E_{32}E_{33}Any 3x3 magic square can be expressed using the three terms, a = (E_{23}-E_{31}), b = (E_{21}-E_{33}), and c = E_{22}.ProofE_{21}+E_{22}+E_{23}= E_{11}+E_{21}+E_{31}==> E_{11}= E_{22}+(E_{23}-E_{31}) = c+a. E_{13}+E_{23}+E_{33}= E_{13}+E_{22}+E_{31}==> E_{33}= E_{22}-(E_{23}-E_{31}) = c-a. E_{21}+E_{22}+E_{23}= E_{13}+E_{23}+E_{33}==> E_{13}= E_{22}+(E_{21}-E_{33}) = c+b. E_{11}+E_{21}+E_{31}= E_{11}+E_{22}+E_{33}==> E_{31}= E_{22}-(E_{21}-E_{33}) = c-b. E_{11}+E_{12}+E_{13}= 3E_{22}==> (E_{22}+a)+E_{12}+(E_{22}+b) = 3E_{22}==> E_{12}= c-(a+b). E_{31}+E_{32}+E_{33}= 3E_{22}==> (E_{22}-b)+E_{32}+(E_{22}-a) = 3E_{22}==> E_{32}= c+(a+b). E_{11}+E_{21}+E_{31}= 3E_{22}==> (E_{22}+a)+E_{21}+(E_{22}-b) = 3E_{22}==> E_{21}= c-(a-b). E_{13}+E_{23}+E_{33}= 3E_{22}==> (E_{22}+b)+E_{23}+(E_{22}-a) = 3E_{22}==> E_{23}= c+(a-b). Substituting a,b,c for the E's:c+a c-(a+b) c+b c-(a-b) c c+(a-b) c-b c+(a+b) c-aAny values for a,b,c make a 3x3 magic square. The sum of each row, column, and diagonal is 3c. Note that there are eight 3-term arithmetic progressions. Four of them run through the center. c-(a-b), c, c+(a-b), with step value (a-b); c-(a+b), c, c+(a+b), with step value (a+b); c-a, c, c+a, with step value a; c-b, c, c+b, with step value b. The other four are c-(a+b), c-b, c+(a-b), with step value a; c-(a-b), c+b, c+(a+b), with step value a; c-(a+b), c-a, c-(a-b), with step value b; c+(a-b), c+a, c+(a+b), with step value b. If we rearrange the terms as follows, c-(a+b) c-b c+(a-b) c-a c c+a c-(a-b) c+b c+(a+b) all rows and columns are 3-term arithmetic progressions. Each row step value is a. Each column step value is b.Duplicate EntriesThe above formulation allows duplicate entries. A general 3x3 magic square can have duplicate entries in several different ways, but if all entries are squares, the situation is very different. A 3x3 magic square of squares will have duplicate entries exactly when ab = 0. This is important both for efficient searching and for a goal to show that there exists no 3x3 magic square of distinct squares.ProofThere are 36 pairs of entries that could be duplicated. Using the Three-Term Formulation, equating each pair of entries, and solving for a and b, produces the following result. A duplication will exist in a general magic square if (a = 0) or (b = 0) or (a = ±b) or (a = ±2b) or (b = ±2a). By symmetry, a and b are interchangeable. Also, negating a or b produces a mirror image solution with the same values. So symmetry reduces the number of duplication patterns to three cases. (1) a = b > 0, (2) a = 2b > 0, (3) a>0, b = 0. Duplicate Case (1) a = b > 0. Substituting into the a,b,c formulation, c+a c-2a c+a c c c c-a c+2a c-a c-2a, c-a, c, c+a, c+2a represent 5 squares in arithmetic progression with step value a. It has been proved impossible for 4 or more squares to be in arithmetic progression, so this case has no solution. Duplicate Case (2) a = 2b > 0. Substituting into the a,b,c formulation, c+2b c-3b c+b c-b c c+b c-b c+3b c-2b c-3b, c-2b, c-b, c, c+b, c+2b, c+3b represent 7 squares in arithmetic progression with step value b. For the same reason as the previous case, there is no solution. Duplicate Case (3) a>0, b = 0. Substituting into the a,b,c formulation, c+a c-a c c-a c c+a c c+a c-a c-a, c, c+a represent 3 squares in arithmetic progression with step value a. The smallest solution is c-a = 1, c = 5^{2}, c+a = 7^{2}, a = 24 producing 7^{2}1^{2}5^{2}1^{2}5^{2}7^{2}5^{2}7^{2}1^{2}Only duplication case (3) can produce solutions, so a 3x3 magic square of squares will have duplicate entries if and only if a=0, b=0, or both.Properties of the EntriesAll Zero or All Non-Zero TheoremIn a 3x3 magic square of squares, either all entries are zero or all entries are non-zero.ProofSuppose p^{2}, q^{2}, r^{2}are three squares in arithmetic progression. and 0<p<q<r. We then have p^{2}+ r^{2}= 2q^{2}. If q = 0 or r = 0, then 0<p<0, thus p = 0. If p = 0, then r^{2}= 2q^{2}, but a square can't be 2 times another square unless they are both 0. Therefore, if any one entry is 0, then all three entries are 0. As shown above in the rearrangement of the Three-Term Formulation, each row and column forms a 3-square arithmetic progression. If one entry is 0, then its row and column are all 0's. Each 0 in the column is part of a row which is in an arithmetic progression, so all rows are 0. Therefore, if one entry is 0, they're all 0.All Odd Or All Even TheoremIn a 3x3 magic square of squares containing non-zero entries, either all entries are odd or all entries are even.ProofThe square of an even number is 0 (mod 4). The square of an odd number is 1 (mod 4). The magic sum of a 3x3 magic square is 3 times the central entry. Each row is the sum of three 0,1 values (mod 4) which equals the magic sum. If the central entry is 0 (mod 4), then the magic sum is 0 (mod 4). The only way to add three 0,1 values to get 0 as a sum is if all values are 0. So if the central entry is even, then all values are even. If the central entry is 1 (mod 4), then the magic sum is 3 (mod 4). The only way to add three 0,1 values to get 3 as a sum is if all values are 1. So if the central entry is odd, then all values are odd.All Triples or All Non-Triples TheoremIn a 3x3 magic square of squares containing non-zero entries, either all entries are multiples of 3 or all entries are non-multiples of 3.ProofThe square of a multiple of 3 is congruent to 0 (mod 3). The square of a non-multiple of 3 is congruent to 1 (mod 3). The magic sum of a 3x3 magic square is 3 times the central entry. Each row is the sum of three 0,1 values (mod 3) which equals the magic sum. If the central entry is 0 (mod 3), then the magic sum is 0 (mod 3). If the central entry is 1 (mod 3), then the magic sum is 0 (mod 3). The only way to add three 0,1 values to get 0 as a sum is if all values are all 0's or all 1's.Multiple of 24 TheoremIn the a,b,c formulation, the step values a and b are multiples of 24.ProofThe squares must be all odd or all even. If all even, then dividing by the biggest power of 2 makes a smaller solution of odd squares. An odd square is congruent to 1 (mod 8). The difference between two squares congruent to 1 (mod 8) is a multiple of 8. This also means that the original undivided solution has step values which are multiples of 8. The squares must all be 0 (mod 3) or all 1 (mod 3). The difference between any two of the squares is 0 (mod 3), so the step values must also be a multiple of 3. Therefore, the step values are multiples of 8 x 3 or 24.Central Entry TheoremIf the central entry has a prime factor of the form 4k+3, then all entries have that factor.Non-Central Entry TheoremIf a non-central entry has a prime factor of the form 8k+3 or 8k+5, then all entries have that factor.No 8k+3 Entry TheoremIf any entry has a prime factor of the form 8k+3, then all entries have that factor.Middle Side Entry TheoremIf a middle side entry has a prime factor of the form 8k+5, then all entries have that factor.Corner Entry TheoremIf a corner entry has a prime factor of the form 4k+3, then the two middle side entries not adjacent to this corner also have that factor.Pythagorean Triangle FormulationAs the Three-Term Formulation shows, a 3x3 magic square of squares contains eight 3-square arithmetic progressions. Each progression can be formulated as a Pythagorean Triangle. Suppose P^{2}, Q^{2}, R^{2}are three squares in arithmetic progression with step value D. Then D = R^{2}- Q^{2}= Q^{2}- P^{2}. Setting P = X - Y, Q = Z, R = X + Y, we have D = (X + Y)^{2}- Z^{2}= Z^{2}- (X - Y)^{2}or (X + Y)^{2}+ (X - Y)^{2}= 2Z^{2}which reduces to X^{2}+ Y^{2}= Z^{2}, the equation of a Pythagorean Triangle. So a 3-square arithmetic progression, (P,Q,R), is equivalent to a Pythagorean Triangle where Q is the hypotenuse, P is the difference of legs, and R is the sum of legs. Also, D = Z^{2}- (X - Y)^{2}which expands to D = Z^{2}- X^{2}- Y^{2}+ 2XY. Since Z^{2}- X^{2}- Y^{2}= 0, we have D = 2XY, thus the step value is 4 times the area of the triangle.Magic Square FormulationsRow FormulationThe rearrangement of entries in the Three-Term Formulation shows that the rows are 3-square arithmetic progressions with the same step value. All columns are also 3-square arithmetic progressions. Note that if the row requirements are satisfied and one column is in arithmetic progression, then the other two columns will follow. If P_{j}^{2}, Q_{j}^{2}, R_{j}^{2}, j = 1,2,3, are the row arithmetic progressions with step value D, then the formulation is D = R_{j}^{2}- Q_{j}^{2}= Q_{j}^{2}- P_{j}^{2}, for j=1,2,3 Q_{1}^{2}+ Q_{3}^{2}= 2Q_{2}^{2}A 3-square arithmetic progression can be formulated as a Pythagorean Triangle. Using this method, we are looking for three Pythagorean Triangles having the same area with the squares of the three hypotenuses in arithmetic progression. If X_{j}^{2}, Y_{j}^{2}, Z_{j}^{2}, j=1,2,3, are the Pythagorean Triangles, then the formulation is X_{j}^{2}+ Y_{j}^{2}= Z_{j}^{2}, for j=1,2,3 X_{1}Y_{1}= X_{2}Y_{2}= X_{3}Y_{3}Z_{1}^{2}+ Z_{3}^{2}= 2Z_{2}^{2}Center FormulationThe Three-Term Formulation shows that there are four 3-square arithmetic progressions that run through the center entry. The step values are a, b, a+b, a-b. Note that a-b, a, a+b is an arithmetic progression with step value b. If P_{j}^{2}, Q_{j}^{2}, R_{j}^{2}, j = 1,2,3,4 are the arithmetic progressions, then the formulation is a = R_{1}^{2}- Q_{1}^{2}= Q_{1}^{2}- P_{1}^{2}b = R_{2}^{2}- Q_{2}^{2}= Q_{2}^{2}- P_{2}^{2}a-b = R_{3}^{2}- Q_{3}^{2}= Q_{3}^{2}- P_{3}^{2}a+b = R_{4}^{2}- Q_{4}^{2}= Q_{4}^{2}- P_{4}^{2}A 3-square arithmetic progression can be formulated as a Pythagorean Triangle. Using this method, we are looking for four Pythagorean Triangles having the same hypotenuse with areas given by a, b, a-b, a+b. If X_{j}^{2}, Y_{j}^{2}, Z_{j}^{2}, j=1,2,3, are the Pythagorean Triangles, then the formulation is X_{j}^{2}+ Y_{j}^{2}= Z_{j}^{2}, for j=1,2,3,4 X_{4}Y_{4}= X_{3}Y_{3}- X_{2}Y_{2}= X_{2}Y_{2}- X_{1}Y_{1}Supporting General FormulasPythagorean Triangle General FormulaSuppose we have a Pythagorean Triangle given by X^{2}+ Y^{2}= Z^{2}. If t = gcd(X,Y), then we can write X = xt, Y = yt and t^{2}x^{2}+ t^{2}y^{2}= Z^{2}or t^{2}(x^{2}+ y^{2}) = Z^{2}which means t must also be a factor of Z. Therefore, Z = zt and factoring out t produces x^{2}+ y^{2}= z^{2}where gcd(x,y) = gcd(x,z) = gcd(y,z) = 1. Rearranging terms, x^{2}= z^{2}- y^{2}= (z + y)(z - y). A square is congruent to 0 or 1 (mod 4), so the sum of two odd squares cannot be a square. Therefore, at least one of x and y is even. But gcd(x,y)=1, so one of x and y is even and the other is odd. Suppose x is even. Then y and z are odd. Thus z+y and z-y are even and x^{2}is a multiple of 4. Dividing both sides by 4, x^{2}/4 = [(z + y)/2][(z - y)/2]. Since gcd(y,z) = 1, gcd((z+y)/2,(z-y)/2) = 1. If the product of two terms with no common factor is a square, then both terms are squares. So there must be m^{2}= (z + y)/2, n^{2}= (z - y)/2 with gcd(m,n) = 1 and then x = 2mn, y = m^{2}- n^{2}, z = m^{2}+ n^{2}. Since y and z are odd, m and n cannot both be odd. Since gcd(m,n)=1, m and n cannot both be even. So one of m and n is odd and the other even. Multiplying these equations by t restores the original triangle, X = 2mnt, Y = (m^{2}- n^{2})t, Z = (m^{2}+ n^{2})t. The area of this triangle is XY/2 = mn(m^{2}- n^{2})t^{2}.Arithmetic Progression General FormulaSince an arithmetic progression of three squares can be represented by a Pythagorean Triangle, which has a general formula, arithmetic progressions must also have a general formula. The Pythagorean Triangle Formulation for P^{2}, Q^{2}, R^{2}, D converted to the Pythagorean Triangle general formula yields P = (m^{2}- n^{2}- 2mn)t Q = (m^{2}+ n^{2})t R = (m^{2}- n^{2}+ 2mn)t D = 4mn(m^{2}- n^{2})t^{2}where m > n, gcd(m,n)=1, m and n are not both odd, t is unrestricted.