K. Pinn et C. Wieczerkowski, NUMBER OF MAGIC SQUARES FROM PARALLEL TEMPERING MONTE-CARLO, International journal of modern physics C, 9(4), 1998, pp. 541-546
There are 880 magic squares of size 4 by 4, and 275 305 224 of size 5
by 5. It seems very difficult if not impossible to count exactly the n
umber of higher order magic squares. We propose a method to estimate t
hese numbers by Monte Carlo simulating magic squares at finite tempera
ture. One is led to perform low temperature simulations of a system wi
th many ground states that are separated by energy barriers. The Paral
lel Tempering Monte Carlo method turns out to be of great help here. O
ur estimate for the number of 6 by 6 magic squares is (0.17745 +/- 0.0
0016) x 10(20).