http://oeis.org/A027567
这种也叫全对称幻方,穷举很快,4×4的计算量很小,5×5的也只要1秒
- {{1,8,10,15},{12,13,3,6},{7,2,16,9},{14,11,5,4}}
- {{1,8,10,15},{14,11,5,4},{7,2,16,9},{12,13,3,6}}
- {{1,8,11,14},{12,13,2,7},{6,3,16,9},{15,10,5,4}}
- {{1,8,11,14},{15,10,5,4},{6,3,16,9},{12,13,2,7}}
- {{1,8,13,12},{14,11,2,7},{4,5,16,9},{15,10,3,6}}
- {{1,8,13,12},{15,10,3,6},{4,5,16,9},{14,11,2,7}}
- {{1,12,6,15},{14,7,9,4},{11,2,16,5},{8,13,3,10}}
- {{1,12,7,14},{15,6,9,4},{10,3,16,5},{8,13,2,11}}
- {{1,12,13,8},{14,7,2,11},{4,9,16,5},{15,6,3,10}}
- {{1,12,13,8},{15,6,3,10},{4,9,16,5},{14,7,2,11}}
- {{1,14,7,12},{15,4,9,6},{10,5,16,3},{8,11,2,13}}
- {{1,14,11,8},{15,4,5,10},{6,9,16,3},{12,7,2,13}}
- {{2,7,9,16},{11,14,4,5},{8,1,15,10},{13,12,6,3}}
- {{2,7,9,16},{13,12,6,3},{8,1,15,10},{11,14,4,5}}
- {{2,7,12,13},{11,14,1,8},{5,4,15,10},{16,9,6,3}}
- {{2,7,12,13},{16,9,6,3},{5,4,15,10},{11,14,1,8}}
- {{2,7,14,11},{13,12,1,8},{3,6,15,10},{16,9,4,5}}
- {{2,7,14,11},{16,9,4,5},{3,6,15,10},{13,12,1,8}}
- {{2,11,5,16},{13,8,10,3},{12,1,15,6},{7,14,4,9}}
- {{2,11,8,13},{16,5,10,3},{9,4,15,6},{7,14,1,12}}
- {{2,11,14,7},{13,8,1,12},{3,10,15,6},{16,5,4,9}}
- {{2,11,14,7},{16,5,4,9},{3,10,15,6},{13,8,1,12}}
- {{2,13,8,11},{16,3,10,5},{9,6,15,4},{7,12,1,14}}
- {{2,13,12,7},{16,3,6,9},{5,10,15,4},{11,8,1,14}}
- {{3,6,9,16},{13,12,7,2},{8,1,14,11},{10,15,4,5}}
- {{3,6,12,13},{16,9,7,2},{5,4,14,11},{10,15,1,8}}
- {{3,6,15,10},{13,12,1,8},{2,7,14,11},{16,9,4,5}}
- {{3,6,15,10},{16,9,4,5},{2,7,14,11},{13,12,1,8}}
- {{3,10,5,16},{13,8,11,2},{12,1,14,7},{6,15,4,9}}
- {{3,10,8,13},{16,5,11,2},{9,4,14,7},{6,15,1,12}}
- {{3,10,15,6},{13,8,1,12},{2,11,14,7},{16,5,4,9}}
- {{3,10,15,6},{16,5,4,9},{2,11,14,7},{13,8,1,12}}
- {{3,13,8,10},{16,2,11,5},{9,7,14,4},{6,12,1,15}}
- {{3,13,12,6},{16,2,7,9},{5,11,14,4},{10,8,1,15}}
- {{4,5,10,15},{14,11,8,1},{7,2,13,12},{9,16,3,6}}
- {{4,5,11,14},{15,10,8,1},{6,3,13,12},{9,16,2,7}}
- {{4,5,16,9},{14,11,2,7},{1,8,13,12},{15,10,3,6}}
- {{4,5,16,9},{15,10,3,6},{1,8,13,12},{14,11,2,7}}
- {{4,9,6,15},{14,7,12,1},{11,2,13,8},{5,16,3,10}}
- {{4,9,7,14},{15,6,12,1},{10,3,13,8},{5,16,2,11}}
- {{4,9,16,5},{14,7,2,11},{1,12,13,8},{15,6,3,10}}
- {{4,9,16,5},{15,6,3,10},{1,12,13,8},{14,7,2,11}}
- {{4,14,7,9},{15,1,12,6},{10,8,13,3},{5,11,2,16}}
- {{4,14,11,5},{15,1,8,10},{6,12,13,3},{9,7,2,16}}
- {{5,4,14,11},{16,9,7,2},{3,6,12,13},{10,15,1,8}}
- {{5,4,15,10},{16,9,6,3},{2,7,12,13},{11,14,1,8}}
- {{6,3,13,12},{15,10,8,1},{4,5,11,14},{9,16,2,7}}
- {{6,3,16,9},{15,10,5,4},{1,8,11,14},{12,13,2,7}}
复制代码 |