Magic Squares of Gaussian Integers
by Lee Morgenstern, January 2012.

In 2010, Lee Sallows constructed a 7-square magic hourglass of Gaussian integers.

It will be found that Gaussian integers don't seem to help much for magic squares of squares, cubes, etc. because many of the same impossibility proofs for rational integers also apply to Gaussian integers.

On the other hand, the magic lines of bimagic, trimagic, and other multimagic squares have a lot of extra solutions in Gaussian integers.

There is a recent article by Timothy Caley, February 2011, "The Prouhet-Tarry-Escott Problem for Gaussian Integers", available from arXiv. Solutions to the PTE problem can be used for the lines of multimagic squares.
This article reviews some of the history of using Gaussian integers for the PTE problem, generalizes and extends some of the work.  It also has some suggestions for how to do computer searches.

3x3 and 4x4 bimagic squares are still impossible because the proof applies to any type of number.
A 5x5 bimagic square of Gaussian integers might be findable with a fairly small computer search because of all the extra solutions of the PTE problem.
Larger order multimagic squares and/or squares with more multi-ness might have construction formulas in Gaussian integers, related to complementary structures.

3x3 magic square of squares of Gaussian integers. Part 1 of 2.
0 in the center

The Sallows solution is a 7-square magic hourglass with 0 in the center.

+----------------------------+
|(1+2i)^2  (-2+2i)^2  (2+i)^2|
|   6          0        -6   |
|(-1+2i)^2  (2+2i)^2  (2-i)^2|
+----------------------------+

Is a 9-square solution possible with 0 in the center?

+-----+
|A B C|
|D 0 E|
|F G H|
+-----+

If 0 is in the center, then the magic sum is 0

and two entries that are opposite to each other must add to 0.

A + H = 0;  B + G = 0;  C + F = 0;  D + E = 0;

thus

H = -A;  G = -B;  F = -C;  E = -D;

produces

+--------+
| A  B  C|
| D  0 -D|
|-C -B -A|
+--------+

Since rational integer squares are positive, this is impossible for non-zero rational integers, but it is possible for squares of Gaussian integers.

However,

-(a+bi)^2 = (c+di)^2

is satisfied only if

(c = b and d = -a) or (c = -b and d = a).

Thus

-(a+bi)^2 = ( +-(b-ai) )^2

------------------------------------------------

Here is a complete formulation of a 3x3 magic square of squares of Gaussian integers with 0 in the center.

+----------------------------+
|(a+bi)^2  (c+di)^2  (e+fi)^2|
|(g+hi)^2     0      (h-gi)^2|
|(f-ei)^2  (d-ci)^2  (b-ai)^2|
+----------------------------+

with

[1] (a+bi)^2 + (c+di)^2 + (e+fi)^2 = 0
[2] (a+bi)^2 + (g+hi)^2 + (f-ei)^2 = 0

Note that satisfying [1] will make a magic hourglass.

Replacing (c+di)^2 with -(d-ci)^2 in [1] and rearranging terms produces

[1a] (a+bi)^2 + (e+fi)^2 = (d-ci)^2

Replacing (f-ei)^2 with -(e+fi)^2, replacing (g+hi)^2 with -(h-gi)^2 in [2], and rearranging terms produces

[2a] (a+bi)^2 - (e+fi)^2 = (h-gi)^2

------------------------------------------------

Condition [1a] can be satisfied by using a simple Pythagorean triple.

The extra two terms in the magic square can be computed from the other entries.

Letting

a = 3, b = 0
e = 4, f = 0
d = 5, c = 0

produces

+----------------------+        +------------+
| (3)^2  (5i)^2   (4)^2|        |  9  -25  16|
|   7       0      -7  | ---->  |  7    0  -7|
|(4i)^2   (5)^2  (3i)^2|        |-16   25  -9|
+----------------------+        +------------+

This is simpler than the Sallows solution.

All magic hourglasses can be produced using the complete formula for Pythagorian triples in Gaussian integers.
The following is from James T. Cross, "Primitive Pythagorean Triples of Gaussian Integers", Mathematics Magazine, 59, April 1986, pp 106-110.

X^2 + Y^2 = Z^2;

is solved by

X = 2mnt/d;  Y = (m^2 - n^2)t/d;  Z = (m^2 + n^2)t/d;

where m, n, t, d are all Gaussian integers,
m and n are coprime,
t is a scale factor, and
d divides 2, is coprime to t, and divides (m^2 +- n^2).

The values of d can be 1, 2, (1+i), (1-i), and their associates.

The Sallows solution is produced by

m = 2+i, n = 1, t = 1, d = 2.

------------------------------------------------

Is a 9-square solution possible with 0 in the center?

No.  Not without duplications.

[1a] and [2a] are discordant forms because the sum and difference of two squares can't both be squares at the same time if all terms are non-zero.

The descent proof of discordance using rational integers also applies to Gaussian integers, with some additional work.

This was proved by David Hilbert in the article "Die Theorie der algebraischen Zahlkorper", Jahresber. Deutsch. Math.-Verein. 4 (1894/1895) 517-525.

------------------------------------------------

Is an 8-square solution possible with 0 in the center?

No.

This is because the 9th entry must have the negative value of the opposite entry which will be a square.  This 9th entry value can always be representated as the square of a Gaussian integer.

Thus, if you have 8 squares, you can make 9 squares, which is impossible.

3x3 magic square of squares of Gaussian integers, Part 2 of 2 .
0 not in the center

If 0 is not in the center, what is possible?

This problem seems to be just as hard in Gaussian integers as it is in rational integers.

There are other quadratic domains where more is possible having to do with arrangements of squares. For example, there can't be four rational squares in arithmetic progression, but there are quadratic domains where you can have up to five squares in arithmetic progression.  That would help somewhat for the 3x3 magic square of squares.  If you could have nine squares in arithmetic progression, that would produce a complete solution.  Perhaps cubic domains are needed.