I am working on a code to print all semimagic squares [1] of a given size. I am working with the following definition:
- An \$n\times n\$ consists of numbers \$1,2,\cdots, n^2\$.
- All numbers must be distinct.
- Sum of each row and each column is equal.
According to Ripatti A. (2018) [1]:
| \$n\$ | number of semimagic squares |
|---|---|
| 1 | 1 |
| 2 | 0 |
| 3 | 9 |
| 4 | 68 688 |
| 5 | 579 043 051 200 |
| 6 | 94 590 660 245 399 996 601 600 |
| \$\cdots\$ | \$\cdots\$ |
If someone knows of any resources that could help me, please let me know.
References
1. Ripatti A. (2018) On the number of semi-magic squares of order 6. arXiv. 10.48550/arXiv.1807.02983