The definition of an AMS only requires the sums to be consecutive integers --
it doesn't say anything about *which* consecutive integers. It turns out,
however, that for a given order, there are only two possibilities for the range
of achievable sums. It also turns out that the diagonal sums are special.
The following proof of these facts is due to Sheng Jiang and Rui-Chen Chen
(Yangzhou University, China):
```
```

`Classification Theorem:`

```
Suppose an AMS(n) exists.
Let
```**c** be the Magic Constant, where
**c** = 1/2***n**(**n**^{2}+1)
Every AMS(n) is either:

- Positive, with sums:
**s**_{min} ... **s**_{max}
where **s**_{min} = **c** - **n** ;
**s**_{max} = **c** + **n** + 1
- Negative, with sums:
**s**_{min} ... **s**_{max}
where **s**_{min} = **c** - **n** - 1;
**s**_{max} = **c** + **n**

### Proof:

Let **r**_{i}, **c**_{i}, **d**_{i} denote the
*i*^{th} row, column, and diagonal sum respectively.
We will find the sum: **S** =
**(r**_{1} + ... + **r**_{n}) +
**(c**_{1} + ... + **c**_{n}) +
**(d**_{1} + **d**_{2})
in two different ways.

We know that **(r**_{1} + ... + **r**_{n}) and
**(c**_{1} + ... + **c**_{n}) are both just the sum
of all the elements in the square, which is **n****c**. So **S** =
2**nc** + **(d**_{1} + **d**_{2})

But **S** is also the sum of the consecutive integers
**s**_{min} ... **s**_{max}. So
**S** = (**n** + 1)(2**s**_{min} + 2**n** + 1)

If we set these expressions equal to each other, we have:

**(d**_{1} + **d**_{2}) =
(**n** + 1)(2**s**_{min} + 2**n** + 1) - 2**nc**
Clearly, the diagonals are greater than the two smallest sums and less than
the two largest sums, or:

(**s**_{min}) + (**s**_{min} + 1) <=
**(d**_{1} + **d**_{2}) <=
(**s**_{min} + 2**n**) + (**s**_{min} + 2**n** + 1)
Substituting our expression for (**d**_{1} + **d**_{2})
and simplifying we get:

**c** - **n** - 3/2 <= **s**_{min} <= **c** - **n** + 1/2
Since we're only working with integers, either
**s**_{min} = **c** - **n** or
**s**_{min} = **c** - **n** - 1

```
Q.E.D.
```

If you have an Anti-Magic square, there are some simple operations you can perform on it to get a different, related square. The most obvious operation is to rotate it 90, 180, or 270 degrees. Or, we could flip the square along some axis. It should be clear that since we haven't disturbed the ordering of the elements in relation to themselves, the sums will be unchanged and our square will still have it's [Anti]-Magic properties. These kind of operations form a group of symmetries which we can exploit when enumerating all squares of a given order.

Composed by John Cormie Updated: March 19, 2000