Bimagic Square General Theorems
Complementary Structure Special Cases
Complementary Number Pairs
Complementary Row Pairs
Self-Complementary Rows
Locally Bimagic Complementary Row Theorem
Odd Central Term Theorem
Structure Alternatives
Bimagic Translation Theorem
Unsymmetric Set Complement Theorem
Complementary Structure Special Cases
Finding a bimagic square can be simplified if it is constrained to
have a certain type of complementary structure.
Complementary Number Pairs
Two numbers are complementary if their sum equals a given constant.
If P is the given constant, then a and P-a are complementary numbers.
Complementary Row Pairs
Two rows are complementary if one row consists of all the
complementary numbers from the other row.
Thus one row consisting of the terms
a, b, ..., e
and the other row consisting of the terms
P-a, P-b, ..., P-e
form a complementary row pair.
Self-Complementary Rows
A row is self-complementary if it consists of complementary number pairs.
Thus a row consisting of
a, P-a, b, P-b
is a self-complementary row.
If the row has an odd number of terms, then the extra term is P/2.
Note that the sum of the terms in a self-complementary row with N terms
is NP/2.
Locally Bimagic Complementary Row Theorem
Two complementary rows that are magic must also be locally bimagic.
If
a+b+...+e = (P-a)+(P-b)+...+(P-e)
then
a2+b2+...+e2 = (P-a)2+(P-b)2+...+(P-e)2.
The sum of squares of another complementary row pair would also be equal
to each other, but not necessarily equal to this pair, thus we must say that
they are only locally bimagic and not globally bimagic.
Proof
Let N be the number of terms in a row.
Let
S = a+b+...+e.
Then
a+b+...+e = (P-a)+(P-b)+...+(P-e)
gives
S = NP - S
or
(1) NP - 2S = 0.
Multiplying out
(P-a)2+(P-b)2+...+(P-e)2
gives
NP2 - 2P(a+b+...+e)+(a2+b2+...+e2)
or
P(NP - 2S) + (a2+b2+...+e2)
which, when combined with (1), reduces to
a2+b2+...+e2.
QED
Note that the sum of the terms of either row of a complementary row pair
having the same sum is NP/2, the same as a self-complementary row.
It is easy to construct magic squares having complementary row pairs,
complementary column pairs, and self-complementary diagonals.
Since they will automatically be locally bimagic, it increases the
chance that one can be found that is globally bimagic.
Note that the order of the terms within the rows doesn't matter
to its bimagic properties. Thus there are several arrangements of
terms in a full square that can have simultaneous complementary
rows and columns. However, for the diagonals to be magic,
a symmetrical structure is required, but there are several kinds.
We use a 4x4 size to illustrate some examples of structure.
a b c d a b c d
e f g h P-b P-a P-d P-c
P-h P-g P-f P-e P-f P-e P-h P-g
P-d P-c P-b P-a e f g h
Note that the rows have the same pairing structure as the columns.
This is so that the diagonals will be self-complementary
and thus have the same sum as the rows and columns.
Other pairing combinations are possible in squares of larger size.
Here are some 5x5 examples.
Note that the center row and column and both diagonals are
self-complementary.
a b c d e a b c d e
f g h i j P-b P-a P-c P-e P-d
k l P/2 P-l P-k f P-f P/2 P-g g
P-j P-i P-h P-g P-f P-i P-h P-j P-l P-k
P-e P-d P-c P-b P-a h i j k l
The first structure is known in the magic square literature as "associated".
There exist 6x6, 7x7, and 8x8 bimagic squares having an associated structure.
The pattern of the second structure is used by the smallest structured
7x7 bimagic square.
Odd Central Term Theorem
In an NxN complementary structured magic square, with N odd,
the central term has the value P/2.
Proof
If S is the magic sum, then the sum of all N rows is NS.
If C is the central term, then
the sum of all terms is P(N2-1)/2 + C, thus
(1) NS = P(N2-1)/2 + C.
The sum of any two rows = 2S.
The sum of two complementary rows not going through the center is NP, thus
2S = NP
or
(2) S = NP/2.
Combining (1) and (2),
C = P/2.
QED
Structure Alternatives
As an alternative to a complementary row pair, we can use two
self-complementary rows.
As an alternative to the two self-complementary diagonals,
we can use a complementary pair.
These alternatives increase the number of arrangements that can
have a compatible structure.
All the rows, columns, and diagonals are guaranteed to be magic;
complementary pairs of rows, columns, or diagonals will be
locally bimagic. So it is just a matter of finding the right
arrangement that is globally bimagic.
Here is an example of an alternative structure.
It is the smallest structured 6x6 bimagic square.
a1 a2 b1 b2 c1 c2
d1 72 18 17 16 49 47
e1 13 52 36 5 50 63
f 38 35 7 66 15 58
g 20 53 34 39 69 4
d2 55 1 57 56 26 24
e2 21 60 68 37 10 23
Columns (a1,a2), (b1,b2), and (c1,c2) are complementary pairs.
Rows (d1,d2) and (e1,e2) are complementary pairs.
Rows f and g are each self-complementary.
The diagonals are a complementary pair.
This alternative structure works for NxN bimagic squares when N is even.
Unfortunately, it doesn't work when N is odd. This is because the central
term must be P/2 and so does the extra term of a self-complementary row.
So lines that go through the center must be self-complementary. No other
lines can be self-complementary or else the P/2 term would be duplicated.
This severely limits the options to find a structured 5x5 bimagic square.
Bimagic Translation Theorem
Translating a bimagic square by adding T to every term
produces another bimagic square.
Proof
Given any two lines in a bimagic square, we have
a+b+...+e = f+g+...+j = S
and
a2+b2+...+e2 = f2+g2+...+j2 = R.
Adding T to every term produces
(a+T)+(b+T)+...+(e+T) = S + NT,
(f+T)+(g+T)+...+(j+T) = S + NT,
and
(a+T)2+(b+T)2+...+(e+T)2 = R + 2ST + NT2,
(f+T)2+(g+T)2+...+(j+T)2 = R + 2ST + NT2.
The sums remain equal and the sums of squares remain equal.
The new magic sum and magic sum of squares depend only on
the previous sums and are not affected by the individual terms
making up the lines.
QED.
Applying this principle, if we subtract P/2 from every term of the
two structured 5x5 bimagic squares, we simplify their formulation.
We change variables so that A = a - (P/2), -A = (P-a) - (P/2), etc.
A B C D E A B C D E
F G H I J -B -A -C -E -D
K L 0 -L -K F -F 0 -G G
-J -I -H -G -F -I -H -J -L -K
-E -D -C -B -A H I J K L
In each square, there are 13 variables:
the 12 lettered variables plus the magic sum of squares.
The center and the magic sum are 0.
Unsymmetric Set Complement Theorem
Bimagic squares come in pairs if they consist of an unsymmetrical set
of numbers. If they do not consist only of complement number pairs, then
by subtracting each term from the sum of the smallest and largest numbers,
a complement solution is obtained with a different magic sum and magic
sum of squares.
Proof
If we negate every term in the square, we produce another bimagic square
with the same magic sum of squares and with the negative of the magic sum.
From the Bimagic Translation Theorem, we can then add the same constant
to every term producing another bimagic square. Thus, if we negate and then
add the sum of the smallest and largest terms, this is equivalent to
subtracting each term from that sum. The smallest term becomes the largest
and the largest becomes the smallest, and every other term is in the middle.
Since the set is not symmetrical, there are numbers without their complements
which become numbers not in the starting set.
If S is the magic sum in an NxN bimagic square, then the magic sum of the
complement solution is NP-S, where P is the sum of the smallest and
largest terms.
QED
This theorem can be used to cut the work almost in half when
searching for a bimagic square having an unsymmetrical set of numbers.
If you are searching with a set of numbers from 1 thru L,
and if you find no solution with magic sum below N(L+1)/2,
then there is no solution with magic sum above N(L+1)/2.
If there were a solution, you would have already found its complement,