(This post is inspired by this recent post at the Futility Closet blog.)

Here is a pretty cool equation.

Why is it cool? Permute the digits of each term in the same way and the equation is still true.

e.g. swapping the second and fourth digits gives

Furthermore, take any **subset** of the digits of each term and equality still holds.

e.g. taking the first and third digits of each term (1) gives

Now for the coolest part – all of the above is true when each term of any of the sums is **squared**!

e.g.

It may not take too long to see why the initial statements are true (i.e. before we started squaring things). The original sum has this form:

where the variables indicate digits.

As long as we have for each digit for , the above sum follows by multiplying both sides by powers of 10 and adding.

This is true in our case for indeed we have .

As long as these sums appear in the same digits place (units, tens, hundreds or thousands), the digits can appear in any order. This explains why any subset or permutation of the digits of (1) should preserve equality.

Now it’s time to look at why equality should hold when the terms are squared.

Firstly notice that the sums of the squares of respective digits are equal.

i.e.

Using the notation as before, we have

For this to equal the desired right side, we know , but we also need to show that the cross terms are equal to . It turns out that this is indeed the case for our special choice of digits.

For convenience let denote the column vector and let (the represents transpose). Then we need to verify the vector dot products ,

where

(For example, .)

Note that each coordinate of is equal to (2/3) of the sum of the coordinates of . In matrix notation this fact can be stated by the relation

where

This can be written as where represents the 3×3 identity matrix.

We may then verify that and so for ,

It follows that the squared sums are equal:

and it can be seen that any subset or permutation of the indices {1,2,3,4} could be chosen in each sum for equality to hold.

(Aside: Note the above is also true if instead of we had the relation , where is any 3×3 permutation matrix ( operates by swapping any two indices of a vector). The orthogonality of the matrix follows from the relations and . The important thing is that the same permutation is used for each .)

In summary the following steps were made in coming up with (1).

- Start with randomly chosen pairs of digits and add a third digit to each pair so that their sum is a multiple of 3. In our case we chose so that the resulting triples have sum .
- Given a triple with sum define the second triple to be . Then it can be verified that for any . In our example, we obtain the triples , or . We make sure the triples are also digits (between 0 and 9).
- Concatenate corresponding digits of each triple to form our sum in (1):

At last we come to the meaning of the title of this post. Integer equations such as

are known as **(2,3)-multigrade equations**. The 2 represents the highest power and the 3 represents the number of terms in each side of the equation.

The following are known about the solutions to such equations.

- If is a solution, so are and for any integer .
- The general solution has the form where are integers satisfying .
- Another form for the general solution is , where are integers.

Note that 1 is straightforward to show while 2 follows from 3 by setting . We will show 3 at the end of this post.

Not all solutions have the property (even after permuting . This was only needed above to ensure that when concatenating two or more digits the squared equation work (i.e. so that the cross-terms equated). For example, and are valid pairs of (2-3)-multigrade equations but after concatenating to form 2-digit numbers, . The solution does not have the property (the sum would need to be a multiple of 3 for this to be possible).

#### Appearance of (2,3)-multigrade solutions in magic squares

Interestingly, if you take any 3×3 magic square (integers in a 3 by 3 array so that the numbers in each row, column and diagonal have the same sum), the first and third rows or columns form solutions to (2,3)-multigrade equations. As an example, take the following instance (copied from here).

The first and third rows give while the first and third columns give . Furthermore by concatenation forwards and backwards we can find many more (2,3)-multigrade equations:

(rows)

(columns)

(diagonals)

(counter-diagonals)

(diagonals)

(counter-diagonals)

All the above hold also when the power indices of 2 are replaced with 1. These six relations (first discovered by Dr Irving Joshua Matrix according to [1]) all follow from the single-digit relations using similar reasoning from before.

The single-digit relations can be verified by using the general form of a 3×3 magic square:

#### General solution to (2,3)-multigrade equations

Finally for completeness we shall derive the general solution of the equation:

We use the procedure outlined in [2]. Take . Substituting gives

This is slightly easier to work with since we can reduce this to an equation of fewer variables. Since ,

and so

To proceed we use the fact that be factorised in the complex numbers as .

We use unique factorisation in the quadratic ring (the Eisenstein integers). We can write numbers in this ring uniquely in the form , where are integers and , one of the cube roots of -1. Visualize Eisenstein integers as elements of an equilateral triangular lattice in the complex plane (as opposed to Gaussian integers which are elements of a square lattice).

Assume that in (2). Then letting both sides of this equation equal , equation (2) represents a factorisation of in two ways.

As factorisation in our ring of Eisenstein integers is unique, this equation must imply that one of the terms, say , must be the product of two non-unit terms, say where are integers. Then pairing up products with their conjugates, the factorisation of (2) can be written in the following two ways.

In other words, and , leading to

Matching coefficients then gives us the general solution . To reach the form given above, we first note that among the four integers , two of them, say and are the same modulo 3. We then let and find that

Hence after adding and dividing by 3 (if all the numbers are divisible by 3), we arrive at the form above. Finally note that adding any constant to each entry also produces a valid solution.

By computational search, we find the single digit non-trivial solutions to and (up to permutations) are given by the following 16 forms.

Most of these can be concatenated to form multi-digit (2,3)-multigrade equations such as (1). The only exceptions are those which do not have sum a multiple of 3: and . More information about (2,3)-multigrade equations can be found in [3].

#### References

[1] A. Benjamin and K. Yasuda, “Magic Squares Indeed!”, Amer. Math. Monthly, Feb. 1999.

[2] Dickson, History of the theory of numbers, available at: http://archive.org/details/historyoftheoryo02dickuoft

[3] T. Piezas, Sum / Sums of three squares – A Collection of Algebraic Identities: https://sites.google.com/site/tpiezas/004

Hello ckrao. There is a small discussion of the multi-grade a^k+b^k+c^k = d^k+e^k+f^k, for k = 1,2, at mathstackexchange.com http://math.stackexchange.com/questions/456824/

Comment by tpiezas — August 2, 2013 @ 1:34 am |

Thanks for pointing this out to me! I could only find some details in Dickson’s book and used the above approach to fill in gaps. The Futility Closet post was also recently mentioned at http://www.reddit.com/r/math/comments/1jht90/the_indestructible_equation/

Comment by ckrao — August 4, 2013 @ 10:36 am |