An order-$n$ magic square is an $n \times n$ matrix over the numbers $\{1, ... ,n^2\}$, each appearing exactly once, whose row and column sums are all equal. Sometimes the sums of the diagonals are required to be equal too.


These objects have a rich history, and they are hugely popular in recreational math. I remember being fascinated by constructions of magic squares when I was 10. It seems natural to ask how many order-$n$ magic squares are there? An exact formula is probably too much to hope for, but it is probably possible to give some asymptotic bounds.


Has anybody asked this question before? Are there known bounds on the number of order-$n$ magic squares?



Asymptotic enumeration of magic squares
This has been asked before on MSE, [here](https://math.stackexchange.com/questions/887990/what-is-the-total-number-of-magic-squares-for-given-n) and [here](https://math.stackexchange.com/questions/1491378/number-of-magic-squares-and-their-applications) for example. According to the [OEIS](http://oeis.org/A006052), not much is known. James E. Ward III wrote a [paper in *Mathematics Magazine*](http://www.jstor.org/stable/2689960) where he derived an upper bound of $(n^2)!/8(2n+1)!$ (where the 8 in the denominator comes from the 8 symmetries of a magic square), but this is surely a gross overestimate. As for lower bounds, there are numerous papers giving constructions of magic squares, but I am not aware of any that make an effort to derive an interesting lower bound on the total number of magic squares.


There has been quite a bit of research on the related question of the number of $n\times n$ squares with nonnegative integer entries whose rows and columns all sum to some given number $s$. This question is more tractable to analyze than your problem, but is still very difficult, and for example I do not think that there is a known asymptotic formula for $s =n(n^2+1)/2$ (and in any case, this would yield an even worse upper bound than Ward's).


