Lee Sallows

Home > Magic Squares > Ambimagic Squares

Some notes on ambimagic squares

 

cogito ergo sum and product



A shortcoming of the usual N×N magic square, it could be said, is an asymmetry in its very definition: all 2N orthogonals must yield the same sum, while only two of the 2N diagonals need comply. This is remedied in panmagic squares, but another solution is found in what I call ambimagic, or additive-multiplicative bi-magic squares, in which again all 2N orthogonals must yield the same sum, while all 2N diagonals are to yield the same product. This 4×4 example uses the smallest possible distinct positive integers:

 1  33   4  22
28  10   7  15
11   3  44   2
20  14   5  21

S = orthogonal sum = 60, P = diagonal product = 9240. Note that the product of the 4 numbers in every toroidally-connected 2×2 subquare is also P. On tiling the plane with this square, every 4×4 area will be ambimagic. The following 4×4 square uses the set of smallest possible distinct integers, half of them negative:

-6 -5  10  1
-8 -3   9  2
 6  5 -10 -1
 8  3  -9 -2    S = 0, P = 360

4×4 ambimagics may simultaneously be ordinary magic squares:

   -3  1 -1  3
-15  5 -5  15    S = 0, P = 360
 12 -4  4 -12    
  6 -2  2  -6   

The two main diagonals add to zero, as do the rows and columns. 

A general formula for order 3 is:

   a     -(a+b)      b
-a(c+1) (a+b)(c+1) -b(c+1)
  ca     -c(a+b)     cb

showing that in 3×3 squares some entries are always negative and S is always zero, while
P = abc(a+b)(c+1). That specimen using the smallest integers is:

  1  -3  2
 -4  12 -8
  3  -9  6         S = 0; P = 72.

Note that in the toroidally-connected square:

1) Every entry is the sum of its four neighbouring corner entries, e.g. 12 = 1 + 2 + 3 + 6, or -4 = -3 + -9 + 6 + 2.

2) The product of the two diagonal entries of any 2×2 subsquare equals the product of the two other diagonal entries; e.g. 1 × 12 = -3 × -4, or 1 × 6 = 2 × 3.

3) The sum of any two entries in the same orthogonal equals the sum of the two entries not in any orthogonal common to either; e.g. -3 + 12 = 3 + 6, or -4 + 3 = -3 + 2.

4) Just like the classes of orthogonally (additive) magic, or diagonally (multiplicative) magic squares of which the class of ambimagics is the intersection, permuting rows and/or columns preserves their properties, which means that on tiling the plane with such a square we can then outline any 3×3 area to discover an ambimagic square.

Using point (2) above, it is easy to see that every entry in a 3×3 ambimagic square is equal to the product of its 4 orthogonal neighbours, divided by P. Hence, given any numerical square, and then dividing every entry by the cube root of P, yields a new square for which P=1. Trouble is, many of the entries may then be irrational numbers. To avoid this, one strategy is start off with an ambimagic square using integers, and for which P is a perfect cube. Dividing all nine integers by the cube-root of P then results in rational entries, and with P = 1. Every entry will then be equal to the product of its 4 orthogonal neighbours, whereas by (1) above, we know that every entry is also equal to the sum of its 4 diagonal neighbours. Below, one such square tiles the plane to result in what I call a magic carpet:
                         .
                         .
                         .
       1/15  -9/10   5/6   1/15  -9/10   5/6
 
      -1/3    9/2  -25/6  -1/3    9/2  -25/6

. . .  4/15 -18/5   10/3   4/15 -18/5   10/3 . . .

       1/15  -9/10   5/6   1/15  -9/10   5/6

      -1/3    9/2  -25/6  -1/3    9/2  -25/6

      4/15  -18/5   10/3   4/15 -18/5   10/3

                         .
                         .
                         .  

Any 3×3 area on this infinite carpet is an ambimagic square, in addition to which, every number is equal to both the sum of its 4 diagonal neightbours as well as the product of its 4 diagonal neighbours.

Mabimagic squares

The dual of an ambimagic square is a "mabimagic" square (mabi to rhyme with "barbie" not "maybe"), being a square in which the orthogonals and diagonals switch roles. In the case of odd order squares the general formula is then merely a rearrangement of the ambimagic formula. Hence for order 3, as follows:

 -c(b+1)   ca    -(a+b)
    a  (a+b)(c+1)  cb
 -c(a+b)    b    -c(a+1)

Applying this same transformation to the 3×3 ambimagic square shown above then yields:

-8   3  -3
 1  12   6
-9   2  -4  

in which the diagonals sum to 0 and othogonals multiply to 72.

This switchability does not apply to squares of even order. In odd order squares every orthogonal intersects with one other orthogonal and likewise for diagonals. But in even order squares each diagonal intersects with another diagonal twice. The symmetry between orthogonals and diagonals thus disappears.

The creation of even-ordered mabimagic squares poses interesting problems. Here is an especially beautiful
4×4 example. Replace A,B,C,D with any 4 distinct non-zero numbers you please. The resulting 16 entries are then all distinct, while every orthogonal multiplies to 1 and every diagonal sums to 0.

  A     B    1/A   1/B

  C     D    1/C   1/D

-1/A  -1/B   -A    -B

-1/C  -1/D   -C    -D

The complementary pairs x and -x are distributed as in Dudeney graphic type I, while the complementary pairs x and 1/x are distributed as in type V. Cyclic permutations of rows and/or columns do not change these properties.

It is easy to prove that no ambimagic can be made using the same entries as this mabimagic square. For in that case, every row and column must sum to zero, so that -A must appear in the same row and column as A. But -A can occur but once.

A rather nice set of numbers to substitue for the variables here is A = x^1, B = x^3, C = x^27, and D = x^23, where x is a 32nd root of unity, or the complex number =  e ^ ip/16. A check will show that the remaining entries then correspond to the 16 odd numbered 32nd roots of unity (x^1, x^3, x^5, .. ,x^31),
a family of points spaced evenly around the periphery of a unit circle centered on the origin of the Argand diagram. If it is symmetry that lends beauty to magic squares then nothing I have ever met excels this specimen.

The above square is an instance of a more general case:

    -a     b    -c   -f*d/b

 -d    -e     f   -a*c/e         P = -(a×c×d×f)
                  
  c   f*d/b   a     -b        S = 0
   
 -f   a*c/e   d      e



Note that the two main diagonals become multiplicatively magic when -a^2 × -e^2 = -f^2 × -(f×d/b)^2 =
-(a×c×d×f), which implies c = -e×f/b and d = a×e×b/f^2. In that case we have a multiplicatively magic square that is also mabimagic, as for example:

12   1   -6  -18

 9   3   -2  -24
 6  18  -12   -1
 2  24   -9   -3


The topic of ambimagic squares, only touched upon here, still offers vast scope for trophy hunters. It is a rewarding field, but a lot tougher than ordinary magic squares. A divining rod will prove handy.

Last Updated:
18-8-2016
  Copyright © Lee Sallows