2

A magic square is a layout of the numbers $1,2, ..., n^2$ in a square of size n where the total of each row, column and diagonal is equal to $n(n^2+1)/2$.

In the book 'The Zen of Magic Squares, Circles and Stars' by C. Pickover, on page 4, I read that the total number of different magic squares of size 3 is 1, size 4 = 880 and size 5 = 275 305 224. My question is the following.

How to calculate the total number of magic squares of size 4, size 5 and if possible size $n$?

Kumar
  • 2,259
  • For said counts, see e.g. the OEIS entry A006052 and its comments/links. – hardmath Aug 05 '14 at 11:02
  • Ok, the summary of the article says that it is not possible for n > 5 Another easy to formulate, yet hard to crack problem, I suppose. – nilo de roock Aug 05 '14 at 11:42
  • The OEIS entry reports a claim about approximating $a(6)$, which puts it around $17\times 10^{18}$. Are you interested in programming to confirm $a(4),a(5)$ or in methods for approximating the higher order counts? – hardmath Aug 05 '14 at 11:46
  • Just read that for n=5 the number was calculated by using brute force. I was just interested if there was some approach ( via combinatorics, generating functions, integer programming or whatever ) to model magic squares and so calculate the total number of them. – nilo de roock Aug 05 '14 at 12:11
  • While there are symmetries (rotating/reflecting the square, replacing every $k$ by $n^2-k+1$) that reduce the counting space, there is an enormous amount of brute force involved in exact values $n \gt 5$. – hardmath Aug 05 '14 at 12:16

0 Answers0