This constant sum, the so-called magic sum is given by

This means that n^{2} numbers are placed in a grid with n rows and n columns. There is a wellknown formula for the sum of first n consecutive numbers:

If we now add up to n^{2}, this formula will change to

With this result it is easy to calculate the magic sum

The following table shows some magic sums:

n | M(n) |
---|---|

3 | 15 |

4 | 34 |

5 | 65 |

6 | 111 |

For a magic square of order n=8 we will get therefore M(8)=260.