Number of classic magic squares

To determine the numbers of magic squares following methods were used:
Exhaustive search by Standard Backtracking: orders 4 and 5
Approximation by Monte Carlo Backtracking: orders 6 to 20 (results for 18 to 20 are not reliable)
Estimation by statistical considerations on magic series combined with extrapolations of known approximations: orders greater than 20
For more details and results of the last method see: Estimates of the number of magic squares

Order Number of
magic squares
Max. expected
relative error
3 1 0 %
4 880 0 %
5 275 305 224 0 %
6   (1.775399 ± 0.000042) · 1019  0.0024 %
7 (3.79809 ± 0.00050) · 1034  0.014 %
8 (5.2225 ± 0.0018) · 1054  0.035 %
9 (7.8448 ± 0.0038) · 1079  0.049 %
10 (2.4149 ± 0.0012) · 10110 0.049 %
11 (2.3358 ± 0.0014) · 10146 0.059 %
12 (1.1424 ± 0.0010) · 10188 0.087 %
13 (4.0333 ± 0.0054) · 10235 0.14 %
14 (1.5057 ± 0.0024) · 10289 0.16 %
15 (8.052 ± 0.022) · 10348 0.27 %
16 (8.509 ± 0.027) · 10414 0.31 %
17 (2.314 ± 0.009) · 10487 0.39 %
18 (2.047 ± 0.008) · 10566 (?) 0.40 %
19 (8.110 ± 0.035) · 10651 (?) 0.44 %
20 (1.810 ± 0.008) · 10744 (?) 0.44 %
21 2.6 · 10843  ~ 15 %
22 3.2 · 10949  ~ 20 %
23 3.9 · 101062 ~ 25 %
24 5.9 · 101182 ~ 30 %
25 1.3 · 101310 ~ 35 %
26 4.9 · 101444 ~ 35 %
27 3.8 · 101586 ~ 40 %
28 7.2 · 101735 ~ 40 %
29 3.8 · 101892 ~ 45 %
30 6.5 · 102056 ~ 45 %

For higher orders see: Estimates of the number of normal magic squares

Back to the Table of Contents

Walter Trump, Nürnberg, Germany, ms(at)trump.de, © 2005-02-08 (last modified: 2018-01-14)