王守恩
发表于 2019-12-30 13:36:03
dlpg070 发表于 2019-12-29 13:13
(1)在旋转对称不去重的条件下,共 得140解。
是这样吗?最好补个图(我还是学不会),别想复杂:
(2)只有1个解(镜像去重),因为中间数只能是5,
(1)只有9个解(镜像去重),因为中间数只能是1——9,
dlpg070
发表于 2019-12-30 13:43:26
本帖最后由 dlpg070 于 2019-12-30 15:33 编辑
chyanog 发表于 2019-12-29 21:11
http://oeis.org/A027567
这种也叫全对称幻方,穷举很快,4×4的计算量很小,5×5的也只要1秒
chyanog具体给出了A027567 4x4 的48个方法的清单,非常好
但好像不是王守恩的4#的"改一下"的解
王守恩为什么说“我要的就是这个”?
chyanog的解那个满足4#?或者只是表达敬意
我验算一下,没找到,请王守恩指点迷津.
王守恩
发表于 2019-12-31 05:17:21
本帖最后由 王守恩 于 2019-12-31 05:26 编辑
chyanog 发表于 2019-12-29 21:11
http://oeis.org/A027567
这种也叫全对称幻方,穷举很快,4×4的计算量很小,5×5的也只要1秒
谢谢 chyanog !宝贵的48组数!
我要的就是这个,我缺少的就是这些。
48组,每组有4串,每串有4个数,
记4个数里较小的1对为小数,则
每组的4对小数只有3种可能;
16,25,38,47,48组数里共出现6次,
17,28,35,46,48组数里共出现6次,
18,27,36,45,48组数里共出现36次,
dingjifen
发表于 2020-1-2 21:22:54
通过翻转旋转后相同的,算几种?
dlpg070
发表于 2020-1-10 18:31:37
本帖最后由 dlpg070 于 2020-1-10 18:33 编辑
王守恩 发表于 2019-12-31 05:17
谢谢 chyanog !宝贵的48组数!
我要的就是这个,我缺少的就是这些。
48组,每组有4串,每串有4个数 ...
4# 的 (4x4 改一下)的解终于出来了
c++搜索,mma验证,虽然又笨又慢,可以安心过大年了
这里给出一例:
1:
1243
5687
13 14 16 15
9 10 12 11
对不?
dlpg070
发表于 2020-1-12 08:58:49
本帖最后由 dlpg070 于 2020-1-12 09:00 编辑
王守恩 发表于 2019-12-31 05:17
谢谢 chyanog !宝贵的48组数!
我要的就是这个,我缺少的就是这些。
48组,每组有4串,每串有4个数 ...
4#问题全部解 384 ,没有去掉旋转翻转相同的
1:
1 2 10 9
3 4 12 11
7 8 16 15
5 6 14 13
用时12.825000秒
2:
1 2 10 9
5 6 14 13
7 8 16 15
3 4 12 11
用时12.826000秒
3:
1 3 11 9
2 4 12 10
6 8 16 14
5 7 15 13
用时13.346000秒
4:
1 3 11 9
5 7 15 13
6 8 16 14
2 4 12 10
用时13.347000秒
5:
1 5 13 9
2 6 14 10
4 8 16 12
3 7 15 11
用时14.272000秒
6:
1 5 13 9
3 7 15 11
4 8 16 12
2 6 14 10
用时14.273000秒
7:
1 2 6 5
3 4 8 7
11 12 16 15
9 10 14 13
用时26.610000秒
8:
1 2 6 5
9 10 14 13
11 12 16 15
3 4 8 7
用时26.611000秒
9:
1 3 7 5
2 4 8 6
10 12 16 14
9 11 15 13
用时27.074000秒
10:
1 3 7 5
9 11 15 13
10 12 16 14
2 4 8 6
用时27.075000秒
11:
1 9 13 5
2 10 14 6
4 12 16 8
3 11 15 7
用时28.756000秒
12:
1 9 13 5
3 11 15 7
4 12 16 8
2 10 14 6
用时28.756000秒
13:
1 2 4 3
5 6 8 7
13 14 16 15
9 10 12 11
用时35.125000秒
14:
1 2 4 3
9 10 12 11
13 14 16 15
5 6 8 7
用时35.126000秒
15:
1 5 7 3
2 6 8 4
10 14 16 12
9 13 15 11
用时36.105000秒
16:
1 5 7 3
9 13 15 11
10 14 16 12
2 6 8 4
用时36.106000秒
17:
1 9 11 3
2 10 12 4
6 14 16 8
5 13 15 7
用时37.812000秒
18:
1 9 11 3
5 13 15 7
6 14 16 8
2 10 12 4
用时37.812000秒
19:
1 3 4 2
5 7 8 6
13 15 16 14
9 11 12 10
用时40.719000秒
20:
1 3 4 2
9 11 12 10
13 15 16 14
5 7 8 6
用时40.720000秒
21:
1 5 6 2
3 7 8 4
11 15 16 12
9 13 14 10
用时41.653000秒
22:
1 5 6 2
9 13 14 10
11 15 16 12
3 7 8 4
用时41.654000秒
23:
1 9 10 2
3 11 12 4
7 15 16 8
5 13 14 6
用时43.041000秒
24:
1 9 10 2
5 13 14 6
7 15 16 8
3 11 12 4
用时43.042000秒
25:
2 1 9 10
4 3 11 12
8 7 15 16
6 5 13 14
用时64.747000秒
26:
2 1 9 10
6 5 13 14
8 7 15 16
4 3 11 12
用时64.748000秒
27:
2 4 12 10
1 3 11 9
5 7 15 13
6 8 16 14
用时66.224000秒
28:
2 4 12 10
6 8 16 14
5 7 15 13
1 3 11 9
用时66.225000秒
29:
2 6 14 10
1 5 13 9
3 7 15 11
4 8 16 12
用时67.079000秒
30:
2 6 14 10
4 8 16 12
3 7 15 11
1 5 13 9
用时67.080000秒
31:
2 1 5 6
4 3 7 8
12 11 15 16
10 9 13 14
用时77.270000秒
32:
2 1 5 6
10 9 13 14
12 11 15 16
4 3 7 8
用时77.271000秒
33:
2 4 8 6
1 3 7 5
9 11 15 13
10 12 16 14
用时78.650000秒
34:
2 4 8 6
10 12 16 14
9 11 15 13
1 3 7 5
用时78.651000秒
35:
2 10 14 6
1 9 13 5
3 11 15 7
4 12 16 8
用时80.237000秒
36:
2 10 14 6
4 12 16 8
3 11 15 7
1 9 13 5
用时80.238000秒
37:
2 1 3 4
6 5 7 8
14 13 15 16
10 9 11 12
用时85.358000秒
38:
2 1 3 4
10 9 11 12
14 13 15 16
6 5 7 8
用时85.359000秒
39:
2 6 8 4
1 5 7 3
9 13 15 11
10 14 16 12
用时87.365000秒
40:
2 6 8 4
10 14 16 12
9 13 15 11
1 5 7 3
用时87.366000秒
41:
2 10 12 4
1 9 11 3
5 13 15 7
6 14 16 8
用时88.891000秒
42:
2 10 12 4
6 14 16 8
5 13 15 7
1 9 11 3
用时88.892000秒
43:
2 4 3 1
6 8 7 5
14 16 15 13
10 12 11 9
用时103.421000秒
44:
2 4 3 1
10 12 11 9
14 16 15 13
6 8 7 5
用时103.422000秒
45:
2 6 5 1
4 8 7 3
12 16 15 11
10 14 13 9
用时104.359000秒
46:
2 6 5 1
10 14 13 9
12 16 15 11
4 8 7 3
用时104.360000秒
47:
2 10 9 1
4 12 11 3
8 16 15 7
6 14 13 5
用时105.755000秒
48:
2 10 9 1
6 14 13 5
8 16 15 7
4 12 11 3
用时105.756000秒
49:
3 1 9 11
4 2 10 12
8 6 14 16
7 5 13 15
用时116.954000秒
50:
3 1 9 11
7 5 13 15
8 6 14 16
4 2 10 12
用时116.955000秒
51:
3 4 12 11
1 2 10 9
5 6 14 13
7 8 16 15
用时118.371000秒
52:
3 4 12 11
7 8 16 15
5 6 14 13
1 2 10 9
用时118.372000秒
53:
3 7 15 11
1 5 13 9
2 6 14 10
4 8 16 12
用时119.704000秒
54:
3 7 15 11
4 8 16 12
2 6 14 10
1 5 13 9
用时119.705000秒
55:
3 1 5 7
4 2 6 8
12 10 14 16
11 9 13 15
用时129.785000秒
56:
3 1 5 7
11 9 13 15
12 10 14 16
4 2 6 8
用时129.786000秒
57:
3 4 8 7
1 2 6 5
9 10 14 13
11 12 16 15
用时131.187000秒
58:
3 4 8 7
11 12 16 15
9 10 14 13
1 2 6 5
用时131.188000秒
59:
3 11 15 7
1 9 13 5
2 10 14 6
4 12 16 8
用时133.298000秒
60:
3 11 15 7
4 12 16 8
2 10 14 6
1 9 13 5
用时133.298000秒
61:
3 1 2 4
7 5 6 8
15 13 14 16
11 9 10 12
用时141.393000秒
62:
3 1 2 4
11 9 10 12
15 13 14 16
7 5 6 8
用时141.394000秒
63:
3 7 8 4
1 5 6 2
9 13 14 10
11 15 16 12
用时143.245000秒
64:
3 7 8 4
11 15 16 12
9 13 14 10
1 5 6 2
用时143.247000秒
65:
3 11 12 4
1 9 10 2
5 13 14 6
7 15 16 8
用时144.379000秒
66:
3 11 12 4
7 15 16 8
5 13 14 6
1 9 10 2
用时144.380000秒
67:
3 4 2 1
7 8 6 5
15 16 14 13
11 12 10 9
用时158.038000秒
68:
3 4 2 1
11 12 10 9
15 16 14 13
7 8 6 5
用时158.039000秒
69:
3 7 5 1
4 8 6 2
12 16 14 10
11 15 13 9
用时159.008000秒
70:
3 7 5 1
11 15 13 9
12 16 14 10
4 8 6 2
用时159.009000秒
71:
3 11 9 1
4 12 10 2
8 16 14 6
7 15 13 5
用时160.708000秒
72:
3 11 9 1
7 15 13 5
8 16 14 6
4 12 10 2
用时160.709000秒
73:
4 2 10 12
3 1 9 11
7 5 13 15
8 6 14 16
用时170.018000秒
74:
4 2 10 12
8 6 14 16
7 5 13 15
3 1 9 11
用时170.019000秒
75:
4 3 11 12
2 1 9 10
6 5 13 14
8 7 15 16
用时170.440000秒
76:
4 3 11 12
8 7 15 16
6 5 13 14
2 1 9 10
用时170.441000秒
77:
4 8 16 12
2 6 14 10
1 5 13 9
3 7 15 11
用时172.789000秒
78:
4 8 16 12
3 7 15 11
1 5 13 9
2 6 14 10
用时172.789000秒
79:
4 2 6 8
3 1 5 7
11 9 13 15
12 10 14 16
用时182.165000秒
80:
4 2 6 8
12 10 14 16
11 9 13 15
3 1 5 7
用时182.166000秒
81:
4 3 7 8
2 1 5 6
10 9 13 14
12 11 15 16
用时182.574000秒
82:
4 3 7 8
12 11 15 16
10 9 13 14
2 1 5 6
用时182.575000秒
83:
4 12 16 8
2 10 14 6
1 9 13 5
3 11 15 7
用时185.597000秒
84:
4 12 16 8
3 11 15 7
1 9 13 5
2 10 14 6
用时185.598000秒
85:
4 2 1 3
8 6 5 7
16 14 13 15
12 10 9 11
用时204.014000秒
86:
4 2 1 3
12 10 9 11
16 14 13 15
8 6 5 7
用时204.015000秒
87:
4 8 7 3
2 6 5 1
10 14 13 9
12 16 15 11
用时206.196000秒
88:
4 8 7 3
12 16 15 11
10 14 13 9
2 6 5 1
用时206.198000秒
89:
4 12 11 3
2 10 9 1
6 14 13 5
8 16 15 7
用时207.330000秒
90:
4 12 11 3
8 16 15 7
6 14 13 5
2 10 9 1
用时207.331000秒
91:
4 3 1 2
8 7 5 6
16 15 13 14
12 11 9 10
用时208.586000秒
92:
4 3 1 2
12 11 9 10
16 15 13 14
8 7 5 6
用时208.587000秒
93:
4 8 6 2
3 7 5 1
11 15 13 9
12 16 14 10
用时210.604000秒
94:
4 8 6 2
12 16 14 10
11 15 13 9
3 7 5 1
用时210.605000秒
95:
4 12 10 2
3 11 9 1
7 15 13 5
8 16 14 6
用时212.106000秒
96:
4 12 10 2
8 16 14 6
7 15 13 5
3 11 9 1
用时212.107000秒
97:
5 1 9 13
6 2 10 14
8 4 12 16
7 3 11 15
用时224.963000秒
98:
5 1 9 13
7 3 11 15
8 4 12 16
6 2 10 14
用时224.964000秒
99:
5 6 14 13
1 2 10 9
3 4 12 11
7 8 16 15
用时227.321000秒
100:
5 6 14 13
7 8 16 15
3 4 12 11
1 2 10 9
用时227.322000秒
101:
5 7 15 13
1 3 11 9
2 4 12 10
6 8 16 14
用时227.726000秒
102:
5 7 15 13
6 8 16 14
2 4 12 10
1 3 11 9
用时227.727000秒
103:
5 1 3 7
6 2 4 8
14 10 12 16
13 9 11 15
用时241.021000秒
104:
5 1 3 7
13 9 11 15
14 10 12 16
6 2 4 8
用时241.022000秒
105:
5 6 8 7
1 2 4 3
9 10 12 11
13 14 16 15
用时242.718000秒
106:
5 6 8 7
13 14 16 15
9 10 12 11
1 2 4 3
用时242.719000秒
107:
5 13 15 7
1 9 11 3
2 10 12 4
6 14 16 8
用时244.403000秒
108:
5 13 15 7
6 14 16 8
2 10 12 4
1 9 11 3
用时244.404000秒
109:
5 1 2 6
7 3 4 8
15 11 12 16
13 9 10 14
用时244.894000秒
110:
5 1 2 6
13 9 10 14
15 11 12 16
7 3 4 8
用时244.895000秒
111:
5 7 8 6
1 3 4 2
9 11 12 10
13 15 16 14
用时246.697000秒
112:
5 7 8 6
13 15 16 14
9 11 12 10
1 3 4 2
用时246.698000秒
113:
5 13 14 6
1 9 10 2
3 11 12 4
7 15 16 8
用时248.067000秒
114:
5 13 14 6
7 15 16 8
3 11 12 4
1 9 10 2
用时248.068000秒
115:
5 6 2 1
7 8 4 3
15 16 12 11
13 14 10 9
用时268.690000秒
116:
5 6 2 1
13 14 10 9
15 16 12 11
7 8 4 3
用时268.691000秒
117:
5 7 3 1
6 8 4 2
14 16 12 10
13 15 11 9
用时269.152000秒
118:
5 7 3 1
13 15 11 9
14 16 12 10
6 8 4 2
用时269.153000秒
119:
5 13 9 1
6 14 10 2
8 16 12 4
7 15 11 3
用时270.831000秒
120:
5 13 9 1
7 15 11 3
8 16 12 4
6 14 10 2
用时270.832000秒
121:
6 2 10 14
5 1 9 13
7 3 11 15
8 4 12 16
用时277.966000秒
122:
6 2 10 14
8 4 12 16
7 3 11 15
5 1 9 13
用时277.967000秒
123:
6 5 13 14
2 1 9 10
4 3 11 12
8 7 15 16
用时279.308000秒
124:
6 5 13 14
8 7 15 16
4 3 11 12
2 1 9 10
用时279.309000秒
125:
6 8 16 14
2 4 12 10
1 3 11 9
5 7 15 13
用时280.713000秒
126:
6 8 16 14
5 7 15 13
1 3 11 9
2 4 12 10
用时280.714000秒
127:
6 2 4 8
5 1 3 7
13 9 11 15
14 10 12 16
用时293.582000秒
128:
6 2 4 8
14 10 12 16
13 9 11 15
5 1 3 7
用时293.583000秒
129:
6 5 7 8
2 1 3 4
10 9 11 12
14 13 15 16
用时294.384000秒
130:
6 5 7 8
14 13 15 16
10 9 11 12
2 1 3 4
用时294.385000秒
131:
6 14 16 8
2 10 12 4
1 9 11 3
5 13 15 7
用时297.050000秒
132:
6 14 16 8
5 13 15 7
1 9 11 3
2 10 12 4
用时297.051000秒
133:
6 2 1 5
8 4 3 7
16 12 11 15
14 10 9 13
用时307.730000秒
134:
6 2 1 5
14 10 9 13
16 12 11 15
8 4 3 7
用时307.731000秒
135:
6 8 7 5
2 4 3 1
10 12 11 9
14 16 15 13
用时309.559000秒
136:
6 8 7 5
14 16 15 13
10 12 11 9
2 4 3 1
用时309.561000秒
137:
6 14 13 5
2 10 9 1
4 12 11 3
8 16 15 7
用时310.931000秒
138:
6 14 13 5
8 16 15 7
4 12 11 3
2 10 9 1
用时310.932000秒
139:
6 5 1 2
8 7 3 4
16 15 11 12
14 13 9 10
用时319.164000秒
140:
6 5 1 2
14 13 9 10
16 15 11 12
8 7 3 4
用时319.166000秒
141:
6 8 4 2
5 7 3 1
13 15 11 9
14 16 12 10
用时320.561000秒
142:
6 8 4 2
14 16 12 10
13 15 11 9
5 7 3 1
用时320.562000秒
143:
6 14 10 2
5 13 9 1
7 15 11 3
8 16 12 4
用时322.153000秒
144:
6 14 10 2
8 16 12 4
7 15 11 3
5 13 9 1
用时322.153000秒
145:
7 3 11 15
5 1 9 13
6 2 10 14
8 4 12 16
用时330.741000秒
146:
7 3 11 15
8 4 12 16
6 2 10 14
5 1 9 13
用时330.742000秒
147:
7 5 13 15
3 1 9 11
4 2 10 12
8 6 14 16
用时331.588000秒
148:
7 5 13 15
8 6 14 16
4 2 10 12
3 1 9 11
用时331.589000秒
149:
7 8 16 15
3 4 12 11
1 2 10 9
5 6 14 13
用时333.035000秒
150:
7 8 16 15
5 6 14 13
1 2 10 9
3 4 12 11
用时333.036000秒
151:
7 3 4 8
5 1 2 6
13 9 10 14
15 11 12 16
用时349.479000秒
152:
7 3 4 8
15 11 12 16
13 9 10 14
5 1 2 6
用时349.480000秒
153:
7 5 6 8
3 1 2 4
11 9 10 12
15 13 14 16
用时350.212000秒
154:
7 5 6 8
15 13 14 16
11 9 10 12
3 1 2 4
用时350.213000秒
155:
7 15 16 8
3 11 12 4
1 9 10 2
5 13 14 6
用时353.493000秒
156:
7 15 16 8
5 13 14 6
1 9 10 2
3 11 12 4
用时353.494000秒
157:
7 3 1 5
8 4 2 6
16 12 10 14
15 11 9 13
用时364.361000秒
158:
7 3 1 5
15 11 9 13
16 12 10 14
8 4 2 6
用时364.362000秒
159:
7 8 6 5
3 4 2 1
11 12 10 9
15 16 14 13
用时366.073000秒
160:
7 8 6 5
15 16 14 13
11 12 10 9
3 4 2 1
用时366.074000秒
161:
7 15 13 5
3 11 9 1
4 12 10 2
8 16 14 6
用时367.776000秒
162:
7 15 13 5
8 16 14 6
4 12 10 2
3 11 9 1
用时367.777000秒
163:
7 5 1 3
8 6 2 4
16 14 10 12
15 13 9 11
用时371.799000秒
164:
7 5 1 3
15 13 9 11
16 14 10 12
8 6 2 4
用时371.800000秒
165:
7 8 4 3
5 6 2 1
13 14 10 9
15 16 12 11
用时373.201000秒
166:
7 8 4 3
15 16 12 11
13 14 10 9
5 6 2 1
用时373.202000秒
167:
7 15 11 3
5 13 9 1
6 14 10 2
8 16 12 4
用时375.270000秒
168:
7 15 11 3
8 16 12 4
6 14 10 2
5 13 9 1
用时375.271000秒
169:
8 4 12 16
6 2 10 14
5 1 9 13
7 3 11 15
用时383.785000秒
170:
8 4 12 16
7 3 11 15
5 1 9 13
6 2 10 14
用时383.786000秒
171:
8 6 14 16
4 2 10 12
3 1 9 11
7 5 13 15
用时384.721000秒
172:
8 6 14 16
7 5 13 15
3 1 9 11
4 2 10 12
用时384.722000秒
173:
8 7 15 16
4 3 11 12
2 1 9 10
6 5 13 14
用时385.214000秒
174:
8 7 15 16
6 5 13 14
2 1 9 10
4 3 11 12
用时385.215000秒
175:
8 4 3 7
6 2 1 5
14 10 9 13
16 12 11 15
用时412.610000秒
176:
8 4 3 7
16 12 11 15
14 10 9 13
6 2 1 5
用时412.611000秒
177:
8 6 5 7
4 2 1 3
12 10 9 11
16 14 13 15
用时413.337000秒
178:
8 6 5 7
16 14 13 15
12 10 9 11
4 2 1 3
用时413.338000秒
179:
8 16 15 7
4 12 11 3
2 10 9 1
6 14 13 5
用时416.605000秒
180:
8 16 15 7
6 14 13 5
2 10 9 1
4 12 11 3
用时416.606000秒
181:
8 4 2 6
7 3 1 5
15 11 9 13
16 12 10 14
用时417.129000秒
182:
8 4 2 6
16 12 10 14
15 11 9 13
7 3 1 5
用时417.130000秒
183:
8 7 5 6
4 3 1 2
12 11 9 10
16 15 13 14
用时417.925000秒
184:
8 7 5 6
16 15 13 14
12 11 9 10
4 3 1 2
用时417.926000秒
185:
8 16 14 6
4 12 10 2
3 11 9 1
7 15 13 5
用时420.611000秒
186:
8 16 14 6
7 15 13 5
3 11 9 1
4 12 10 2
用时420.613000秒
187:
8 6 2 4
7 5 1 3
15 13 9 11
16 14 10 12
用时424.271000秒
188:
8 6 2 4
16 14 10 12
15 13 9 11
7 5 1 3
用时424.272000秒
189:
8 7 3 4
6 5 1 2
14 13 9 10
16 15 11 12
用时424.694000秒
190:
8 7 3 4
16 15 11 12
14 13 9 10
6 5 1 2
用时424.696000秒
191:
8 16 12 4
6 14 10 2
5 13 9 1
7 15 11 3
用时427.709000秒
192:
8 16 12 4
7 15 11 3
5 13 9 1
6 14 10 2
用时427.710000秒
193:
9 1 5 13
10 2 6 14
12 4 8 16
11 3 7 15
用时445.792000秒
194:
9 1 5 13
11 3 7 15
12 4 8 16
10 2 6 14
用时445.793000秒
195:
9 10 14 13
1 2 6 5
3 4 8 7
11 12 16 15
用时448.889000秒
196:
9 10 14 13
11 12 16 15
3 4 8 7
1 2 6 5
用时448.890000秒
197:
9 11 15 13
1 3 7 5
2 4 8 6
10 12 16 14
用时449.300000秒
198:
9 11 15 13
10 12 16 14
2 4 8 6
1 3 7 5
用时449.301000秒
199:
9 1 3 11
10 2 4 12
14 6 8 16
13 5 7 15
用时453.012000秒
200:
9 1 3 11
13 5 7 15
14 6 8 16
10 2 4 12
用时453.013000秒
201:
9 10 12 11
1 2 4 3
5 6 8 7
13 14 16 15
用时455.728000秒
202:
9 10 12 11
13 14 16 15
5 6 8 7
1 2 4 3
用时455.729000秒
203:
9 13 15 11
1 5 7 3
2 6 8 4
10 14 16 12
用时456.561000秒
204:
9 13 15 11
10 14 16 12
2 6 8 4
1 5 7 3
用时456.563000秒
205:
9 1 2 10
11 3 4 12
15 7 8 16
13 5 6 14
用时457.089000秒
206:
9 1 2 10
13 5 6 14
15 7 8 16
11 3 4 12
用时457.090000秒
207:
9 11 12 10
1 3 4 2
5 7 8 6
13 15 16 14
用时460.415000秒
208:
9 11 12 10
13 15 16 14
5 7 8 6
1 3 4 2
用时460.416000秒
209:
9 13 14 10
1 5 6 2
3 7 8 4
11 15 16 12
用时461.177000秒
210:
9 13 14 10
11 15 16 12
3 7 8 4
1 5 6 2
用时461.178000秒
211:
9 10 2 1
11 12 4 3
15 16 8 7
13 14 6 5
用时488.625000秒
212:
9 10 2 1
13 14 6 5
15 16 8 7
11 12 4 3
用时488.626000秒
213:
9 11 3 1
10 12 4 2
14 16 8 6
13 15 7 5
用时489.121000秒
214:
9 11 3 1
13 15 7 5
14 16 8 6
10 12 4 2
用时489.122000秒
215:
9 13 5 1
10 14 6 2
12 16 8 4
11 15 7 3
用时490.035000秒
216:
9 13 5 1
11 15 7 3
12 16 8 4
10 14 6 2
用时490.036000秒
217:
10 2 6 14
9 1 5 13
11 3 7 15
12 4 8 16
用时498.641000秒
218:
10 2 6 14
12 4 8 16
11 3 7 15
9 1 5 13
用时498.641000秒
219:
10 9 13 14
2 1 5 6
4 3 7 8
12 11 15 16
用时500.718000秒
220:
10 9 13 14
12 11 15 16
4 3 7 8
2 1 5 6
用时500.719000秒
221:
10 12 16 14
2 4 8 6
1 3 7 5
9 11 15 13
用时502.108000秒
222:
10 12 16 14
9 11 15 13
1 3 7 5
2 4 8 6
用时502.109000秒
223:
10 2 4 12
9 1 3 11
13 5 7 15
14 6 8 16
用时506.092000秒
224:
10 2 4 12
14 6 8 16
13 5 7 15
9 1 3 11
用时506.093000秒
225:
10 9 11 12
2 1 3 4
6 5 7 8
14 13 15 16
用时507.793000秒
226:
10 9 11 12
14 13 15 16
6 5 7 8
2 1 3 4
用时507.794000秒
227:
10 14 16 12
2 6 8 4
1 5 7 3
9 13 15 11
用时509.623000秒
228:
10 14 16 12
9 13 15 11
1 5 7 3
2 6 8 4
用时509.625000秒
229:
10 2 1 9
12 4 3 11
16 8 7 15
14 6 5 13
用时520.598000秒
230:
10 2 1 9
14 6 5 13
16 8 7 15
12 4 3 11
用时520.598000秒
231:
10 12 11 9
2 4 3 1
6 8 7 5
14 16 15 13
用时523.929000秒
232:
10 12 11 9
14 16 15 13
6 8 7 5
2 4 3 1
用时523.930000秒
233:
10 14 13 9
2 6 5 1
4 8 7 3
12 16 15 11
用时524.664000秒
234:
10 14 13 9
12 16 15 11
4 8 7 3
2 6 5 1
用时524.666000秒
235:
10 9 1 2
12 11 3 4
16 15 7 8
14 13 5 6
用时541.230000秒
236:
10 9 1 2
14 13 5 6
16 15 7 8
12 11 3 4
用时541.231000秒
237:
10 12 4 2
9 11 3 1
13 15 7 5
14 16 8 6
用时542.679000秒
238:
10 12 4 2
14 16 8 6
13 15 7 5
9 11 3 1
用时542.680000秒
239:
10 14 6 2
9 13 5 1
11 15 7 3
12 16 8 4
用时543.549000秒
240:
10 14 6 2
12 16 8 4
11 15 7 3
9 13 5 1
用时543.550000秒
241:
11 3 7 15
9 1 5 13
10 2 6 14
12 4 8 16
用时552.197000秒
242:
11 3 7 15
12 4 8 16
10 2 6 14
9 1 5 13
用时552.198000秒
243:
11 9 13 15
3 1 5 7
4 2 6 8
12 10 14 16
用时553.822000秒
244:
11 9 13 15
12 10 14 16
4 2 6 8
3 1 5 7
用时553.824000秒
245:
11 12 16 15
3 4 8 7
1 2 6 5
9 10 14 13
用时555.254000秒
246:
11 12 16 15
9 10 14 13
1 2 6 5
3 4 8 7
用时555.255000秒
247:
11 3 4 12
9 1 2 10
13 5 6 14
15 7 8 16
用时563.655000秒
248:
11 3 4 12
15 7 8 16
13 5 6 14
9 1 2 10
用时563.656000秒
249:
11 9 10 12
3 1 2 4
7 5 6 8
15 13 14 16
用时565.064000秒
250:
11 9 10 12
15 13 14 16
7 5 6 8
3 1 2 4
用时565.065000秒
251:
11 15 16 12
3 7 8 4
1 5 6 2
9 13 14 10
用时566.906000秒
252:
11 15 16 12
9 13 14 10
1 5 6 2
3 7 8 4
用时566.907000秒
253:
11 3 1 9
12 4 2 10
16 8 6 14
15 7 5 13
用时577.731000秒
254:
11 3 1 9
15 7 5 13
16 8 6 14
12 4 2 10
用时577.732000秒
255:
11 12 10 9
3 4 2 1
7 8 6 5
15 16 14 13
用时580.425000秒
256:
11 12 10 9
15 16 14 13
7 8 6 5
3 4 2 1
用时580.426000秒
257:
11 15 13 9
3 7 5 1
4 8 6 2
12 16 14 10
用时581.238000秒
258:
11 15 13 9
12 16 14 10
4 8 6 2
3 7 5 1
用时581.240000秒
259:
11 9 1 3
12 10 2 4
16 14 6 8
15 13 5 7
用时594.181000秒
260:
11 9 1 3
15 13 5 7
16 14 6 8
12 10 2 4
用时594.183000秒
261:
11 12 4 3
9 10 2 1
13 14 6 5
15 16 8 7
用时595.576000秒
262:
11 12 4 3
15 16 8 7
13 14 6 5
9 10 2 1
用时595.577000秒
263:
11 15 7 3
9 13 5 1
10 14 6 2
12 16 8 4
用时596.936000秒
264:
11 15 7 3
12 16 8 4
10 14 6 2
9 13 5 1
用时596.937000秒
265:
12 4 8 16
10 2 6 14
9 1 5 13
11 3 7 15
用时604.133000秒
266:
12 4 8 16
11 3 7 15
9 1 5 13
10 2 6 14
用时604.134000秒
267:
12 10 14 16
4 2 6 8
3 1 5 7
11 9 13 15
用时605.858000秒
268:
12 10 14 16
11 9 13 15
3 1 5 7
4 2 6 8
用时605.859000秒
269:
12 11 15 16
4 3 7 8
2 1 5 6
10 9 13 14
用时606.389000秒
270:
12 11 15 16
10 9 13 14
2 1 5 6
4 3 7 8
用时606.389000秒
271:
12 4 3 11
10 2 1 9
14 6 5 13
16 8 7 15
用时627.189000秒
272:
12 4 3 11
16 8 7 15
14 6 5 13
10 2 1 9
用时627.190000秒
273:
12 10 9 11
4 2 1 3
8 6 5 7
16 14 13 15
用时628.601000秒
274:
12 10 9 11
16 14 13 15
8 6 5 7
4 2 1 3
用时628.602000秒
275:
12 16 15 11
4 8 7 3
2 6 5 1
10 14 13 9
用时630.448000秒
276:
12 16 15 11
10 14 13 9
2 6 5 1
4 8 7 3
用时630.449000秒
277:
12 4 2 10
11 3 1 9
15 7 5 13
16 8 6 14
用时630.944000秒
278:
12 4 2 10
16 8 6 14
15 7 5 13
11 3 1 9
用时630.946000秒
279:
12 11 9 10
4 3 1 2
8 7 5 6
16 15 13 14
用时632.677000秒
280:
12 11 9 10
16 15 13 14
8 7 5 6
4 3 1 2
用时632.678000秒
281:
12 16 14 10
4 8 6 2
3 7 5 1
11 15 13 9
用时634.386000秒
282:
12 16 14 10
11 15 13 9
3 7 5 1
4 8 6 2
用时634.387000秒
283:
12 10 2 4
11 9 1 3
15 13 5 7
16 14 6 8
用时648.042000秒
284:
12 10 2 4
16 14 6 8
15 13 5 7
11 9 1 3
用时648.043000秒
285:
12 11 3 4
10 9 1 2
14 13 5 6
16 15 7 8
用时648.445000秒
286:
12 11 3 4
16 15 7 8
14 13 5 6
10 9 1 2
用时648.446000秒
287:
12 16 8 4
10 14 6 2
9 13 5 1
11 15 7 3
用时650.806000秒
288:
12 16 8 4
11 15 7 3
9 13 5 1
10 14 6 2
用时650.806000秒
289:
13 5 7 15
9 1 3 11
10 2 4 12
14 6 8 16
用时663.717000秒
290:
13 5 7 15
14 6 8 16
10 2 4 12
9 1 3 11
用时663.718000秒
291:
13 9 11 15
5 1 3 7
6 2 4 8
14 10 12 16
用时665.266000秒
292:
13 9 11 15
14 10 12 16
6 2 4 8
5 1 3 7
用时665.267000秒
293:
13 14 16 15
5 6 8 7
1 2 4 3
9 10 12 11
用时667.317000秒
294:
13 14 16 15
9 10 12 11
1 2 4 3
5 6 8 7
用时667.318000秒
295:
13 5 6 14
9 1 2 10
11 3 4 12
15 7 8 16
用时668.569000秒
296:
13 5 6 14
15 7 8 16
11 3 4 12
9 1 2 10
用时668.570000秒
297:
13 9 10 14
5 1 2 6
7 3 4 8
15 11 12 16
用时669.730000秒
298:
13 9 10 14
15 11 12 16
7 3 4 8
5 1 2 6
用时669.732000秒
299:
13 15 16 14
5 7 8 6
1 3 4 2
9 11 12 10
用时671.594000秒
300:
13 15 16 14
9 11 12 10
1 3 4 2
5 7 8 6
用时671.595000秒
301:
13 5 1 9
14 6 2 10
16 8 4 12
15 7 3 11
用时690.161000秒
302:
13 5 1 9
15 7 3 11
16 8 4 12
14 6 2 10
用时690.162000秒
303:
13 14 10 9
5 6 2 1
7 8 4 3
15 16 12 11
用时693.244000秒
304:
13 14 10 9
15 16 12 11
7 8 4 3
5 6 2 1
用时693.245000秒
305:
13 15 11 9
5 7 3 1
6 8 4 2
14 16 12 10
用时693.668000秒
306:
13 15 11 9
14 16 12 10
6 8 4 2
5 7 3 1
用时693.669000秒
307:
13 9 1 5
14 10 2 6
16 12 4 8
15 11 3 7
用时703.012000秒
308:
13 9 1 5
15 11 3 7
16 12 4 8
14 10 2 6
用时703.013000秒
309:
13 14 6 5
9 10 2 1
11 12 4 3
15 16 8 7
用时705.373000秒
310:
13 14 6 5
15 16 8 7
11 12 4 3
9 10 2 1
用时705.374000秒
311:
13 15 7 5
9 11 3 1
10 12 4 2
14 16 8 6
用时705.802000秒
312:
13 15 7 5
14 16 8 6
10 12 4 2
9 11 3 1
用时705.802000秒
313:
14 6 8 16
10 2 4 12
9 1 3 11
13 5 7 15
用时715.086000秒
314:
14 6 8 16
13 5 7 15
9 1 3 11
10 2 4 12
用时715.087000秒
315:
14 10 12 16
6 2 4 8
5 1 3 7
13 9 11 15
用时716.767000秒
316:
14 10 12 16
13 9 11 15
5 1 3 7
6 2 4 8
用时716.768000秒
317:
14 13 15 16
6 5 7 8
2 1 3 4
10 9 11 12
用时717.739000秒
318:
14 13 15 16
10 9 11 12
2 1 3 4
6 5 7 8
用时717.740000秒
319:
14 6 5 13
10 2 1 9
12 4 3 11
16 8 7 15
用时731.543000秒
320:
14 6 5 13
16 8 7 15
12 4 3 11
10 2 1 9
用时731.544000秒
321:
14 10 9 13
6 2 1 5
8 4 3 7
16 12 11 15
用时732.715000秒
322:
14 10 9 13
16 12 11 15
8 4 3 7
6 2 1 5
用时732.717000秒
323:
14 16 15 13
6 8 7 5
2 4 3 1
10 12 11 9
用时734.635000秒
324:
14 16 15 13
10 12 11 9
2 4 3 1
6 8 7 5
用时734.636000秒
325:
14 6 2 10
13 5 1 9
15 7 3 11
16 8 4 12
用时742.861000秒
326:
14 6 2 10
16 8 4 12
15 7 3 11
13 5 1 9
用时742.862000秒
327:
14 13 9 10
6 5 1 2
8 7 3 4
16 15 11 12
用时744.969000秒
328:
14 13 9 10
16 15 11 12
8 7 3 4
6 5 1 2
用时744.970000秒
329:
14 16 12 10
6 8 4 2
5 7 3 1
13 15 11 9
用时746.413000秒
330:
14 16 12 10
13 15 11 9
5 7 3 1
6 8 4 2
用时746.414000秒
331:
14 10 2 6
13 9 1 5
15 11 3 7
16 12 4 8
用时756.622000秒
332:
14 10 2 6
16 12 4 8
15 11 3 7
13 9 1 5
用时756.623000秒
333:
14 13 5 6
10 9 1 2
12 11 3 4
16 15 7 8
用时757.986000秒
334:
14 13 5 6
16 15 7 8
12 11 3 4
10 9 1 2
用时757.987000秒
335:
14 16 8 6
10 12 4 2
9 11 3 1
13 15 7 5
用时759.444000秒
336:
14 16 8 6
13 15 7 5
9 11 3 1
10 12 4 2
用时759.445000秒
337:
15 7 8 16
11 3 4 12
9 1 2 10
13 5 6 14
用时770.685000秒
338:
15 7 8 16
13 5 6 14
9 1 2 10
11 3 4 12
用时770.686000秒
339:
15 11 12 16
7 3 4 8
5 1 2 6
13 9 10 14
用时772.073000秒
340:
15 11 12 16
13 9 10 14
5 1 2 6
7 3 4 8
用时772.074000秒
341:
15 13 14 16
7 5 6 8
3 1 2 4
11 9 10 12
用时773.036000秒
342:
15 13 14 16
11 9 10 12
3 1 2 4
7 5 6 8
用时773.037000秒
343:
15 7 5 13
11 3 1 9
12 4 2 10
16 8 6 14
用时787.784000秒
344:
15 7 5 13
16 8 6 14
12 4 2 10
11 3 1 9
用时787.785000秒
345:
15 11 9 13
7 3 1 5
8 4 2 6
16 12 10 14
用时789.326000秒
346:
15 11 9 13
16 12 10 14
8 4 2 6
7 3 1 5
用时789.328000秒
347:
15 16 14 13
7 8 6 5
3 4 2 1
11 12 10 9
用时791.396000秒
348:
15 16 14 13
11 12 10 9
3 4 2 1
7 8 6 5
用时791.398000秒
349:
15 7 3 11
13 5 1 9
14 6 2 10
16 8 4 12
用时796.645000秒
350:
15 7 3 11
16 8 4 12
14 6 2 10
13 5 1 9
用时796.645000秒
351:
15 13 9 11
7 5 1 3
8 6 2 4
16 14 10 12
用时798.269000秒
352:
15 13 9 11
16 14 10 12
8 6 2 4
7 5 1 3
用时798.270000秒
353:
15 16 12 11
7 8 4 3
5 6 2 1
13 14 10 9
用时799.690000秒
354:
15 16 12 11
13 14 10 9
5 6 2 1
7 8 4 3
用时799.691000秒
355:
15 11 3 7
13 9 1 5
14 10 2 6
16 12 4 8
用时809.890000秒
356:
15 11 3 7
16 12 4 8
14 10 2 6
13 9 1 5
用时809.891000秒
357:
15 13 5 7
11 9 1 3
12 10 2 4
16 14 6 8
用时810.763000秒
358:
15 13 5 7
16 14 6 8
12 10 2 4
11 9 1 3
用时810.764000秒
359:
15 16 8 7
11 12 4 3
9 10 2 1
13 14 6 5
用时812.263000秒
360:
15 16 8 7
13 14 6 5
9 10 2 1
11 12 4 3
用时812.264000秒
361:
16 8 7 15
12 4 3 11
10 2 1 9
14 6 5 13
用时834.166000秒
362:
16 8 7 15
14 6 5 13
10 2 1 9
12 4 3 11
用时834.167000秒
363:
16 12 11 15
8 4 3 7
6 2 1 5
14 10 9 13
用时835.552000秒
364:
16 12 11 15
14 10 9 13
6 2 1 5
8 4 3 7
用时835.553000秒
365:
16 14 13 15
8 6 5 7
4 2 1 3
12 10 9 11
用时836.494000秒
366:
16 14 13 15
12 10 9 11
4 2 1 3
8 6 5 7
用时836.495000秒
367:
16 8 6 14
12 4 2 10
11 3 1 9
15 7 5 13
用时839.379000秒
368:
16 8 6 14
15 7 5 13
11 3 1 9
12 4 2 10
用时839.380000秒
369:
16 12 10 14
8 4 2 6
7 3 1 5
15 11 9 13
用时841.064000秒
370:
16 12 10 14
15 11 9 13
7 3 1 5
8 4 2 6
用时841.066000秒
371:
16 15 13 14
8 7 5 6
4 3 1 2
12 11 9 10
用时842.037000秒
372:
16 15 13 14
12 11 9 10
4 3 1 2
8 7 5 6
用时842.038000秒
373:
16 8 4 12
14 6 2 10
13 5 1 9
15 7 3 11
用时848.426000秒
374:
16 8 4 12
15 7 3 11
13 5 1 9
14 6 2 10
用时848.426000秒
375:
16 14 10 12
8 6 2 4
7 5 1 3
15 13 9 11
用时850.111000秒
376:
16 14 10 12
15 13 9 11
7 5 1 3
8 6 2 4
用时850.113000秒
377:
16 15 11 12
8 7 3 4
6 5 1 2
14 13 9 10
用时850.588000秒
378:
16 15 11 12
14 13 9 10
6 5 1 2
8 7 3 4
用时850.590000秒
379:
16 12 4 8
14 10 2 6
13 9 1 5
15 11 3 7
用时863.060000秒
380:
16 12 4 8
15 11 3 7
13 9 1 5
14 10 2 6
用时863.061000秒
381:
16 14 6 8
12 10 2 4
11 9 1 3
15 13 5 7
用时863.977000秒
382:
16 14 6 8
15 13 5 7
11 9 1 3
12 10 2 4
用时863.978000秒
383:
16 15 7 8
12 11 3 4
10 9 1 2
14 13 5 6
用时864.491000秒
384:
16 15 7 8
14 13 5 6
10 9 1 2
12 11 3 4
用时864.492000秒
sum=384
=== end ===
去掉旋转和翻转相同的
王守恩4#问题(类似4阶幻方)的解数是
384/8= 48
16*3=48个解
chyanog说:穷举很快,4×4的计算量很小,5×5的也只要1秒,
太神奇了.
我改用c++,对王守恩4#问题深入分析后多次改进,
仍需要865秒,有谁能给出快速搜索代码,多谢了.
chyanog
发表于 2020-1-12 10:14:27
本帖最后由 chyanog 于 2020-1-12 11:41 编辑
dlpg070 发表于 2020-1-12 08:58
4#问题全部解 384 ,没有去掉旋转翻转相同的
1:
1 2 10 9
Mathematica代码,计算5×5的把n=4改成n=5即可。ans表示搜到的所有结果,ans2表示去重后的结果。计算5×5的搜索量稍大,有Mathematica能识别的C编译器就能秒出。
n = 4;
TextGrid, Frame -> All]
eqn = Table, {j, n}] == Sum, {j, n}] == Sum], {j, n}] == Sum], {j, n}] == Sum/n, {i, n}];
F = Symbol["i" <> ToString[#]] &;
sol = Solve, Integers,GeneratedParameters -> F][] // Normal;
TextGrid
A = Flatten;
k = Length];
cond = And @@ Thread] <= n^2] &&Unequal @@ A // LogicalExpand;
iter = Table[{F, If == Last@Sort@Cases[#, _Symbol, -1] &], Evaluate@If, 0]}, {i, k}];
cf = Compile[{{i1, _Integer}},
Module[{B = Internal`Bag},
Do, ##2];
Internal`BagPart],
RuntimeAttributes -> {Listable},CompilationTarget -> "C", RuntimeOptions -> "Speed"
] &;
ans = ArrayReshape[#, {Length]/n^2, n, n}] &@ cf]; // AbsoluteTiming
func = Sort@{#, Transpose], Reverse[#, {1, 2}], Transpose], Transpose@Reverse[#, {1, 2}], Transpose[#], Reverse[#], Reverse[#, 2]} &;
ans2 = DeleteDuplicatesBy; // AbsoluteTiming
Dimensions /@ {ans, ans2}
dlpg070
发表于 2020-1-12 13:13:14
chyanog 发表于 2020-1-12 10:14
Mathematica代码,计算5×5的把n=4改成n=5即可。ans表示搜到的所有结果,ans2表示去重后的结果。计算5 ...
验证代码表明代码确实漂亮
特别是给出了算法设计思路,使得读代码容易许多。
我用2个Grid显示了ans 和 ans2,很好
我在考虑如何用于王守恩的4#问题,估计困难不大了.
反思我之前mma代码慢的主要原因是我直接用了16个变量求解!!!
这个解题思路与"奥运五环"有相似之处,但我模仿没成功。
再次感谢
dlpg070
发表于 2020-1-12 18:16:39
本帖最后由 dlpg070 于 2020-1-12 18:21 编辑
利用 chyanog 源码改写eqn求解4#王守恩问题
速度快得不可思议(约10毫秒),与我的865秒不可同日而语
Out= {0.0012274,Null}
Out= {0.00934484,Null}
Out= {{384,4,4},{48,4,4}}
全部解 384个 清单:
1 {{1,2,4,3},{5,6,8,7},{13,14,16,15},{9,10,12,11}}
2 {{1,2,4,3},{9,10,12,11},{13,14,16,15},{5,6,8,7}}
3 {{1,2,6,5},{3,4,8,7},{11,12,16,15},{9,10,14,13}}
4 {{1,2,6,5},{9,10,14,13},{11,12,16,15},{3,4,8,7}}
5 {{1,2,10,9},{3,4,12,11},{7,8,16,15},{5,6,14,13}}
6 {{1,2,10,9},{5,6,14,13},{7,8,16,15},{3,4,12,11}}
7 {{1,3,4,2},{5,7,8,6},{13,15,16,14},{9,11,12,10}}
8 {{1,3,4,2},{9,11,12,10},{13,15,16,14},{5,7,8,6}}
9 {{1,3,7,5},{2,4,8,6},{10,12,16,14},{9,11,15,13}}
10 {{1,3,7,5},{9,11,15,13},{10,12,16,14},{2,4,8,6}}
11 {{1,3,11,9},{2,4,12,10},{6,8,16,14},{5,7,15,13}}
12 {{1,3,11,9},{5,7,15,13},{6,8,16,14},{2,4,12,10}}
13 {{1,5,6,2},{3,7,8,4},{11,15,16,12},{9,13,14,10}}
14 {{1,5,6,2},{9,13,14,10},{11,15,16,12},{3,7,8,4}}
15 {{1,5,7,3},{2,6,8,4},{10,14,16,12},{9,13,15,11}}
16 {{1,5,7,3},{9,13,15,11},{10,14,16,12},{2,6,8,4}}
17 {{1,5,13,9},{2,6,14,10},{4,8,16,12},{3,7,15,11}}
18 {{1,5,13,9},{3,7,15,11},{4,8,16,12},{2,6,14,10}}
19 {{1,9,10,2},{3,11,12,4},{7,15,16,8},{5,13,14,6}}
20 {{1,9,10,2},{5,13,14,6},{7,15,16,8},{3,11,12,4}}
21 {{1,9,11,3},{2,10,12,4},{6,14,16,8},{5,13,15,7}}
22 {{1,9,11,3},{5,13,15,7},{6,14,16,8},{2,10,12,4}}
23 {{1,9,13,5},{2,10,14,6},{4,12,16,8},{3,11,15,7}}
24 {{1,9,13,5},{3,11,15,7},{4,12,16,8},{2,10,14,6}}
25 {{2,1,3,4},{6,5,7,8},{14,13,15,16},{10,9,11,12}}
26 {{2,1,3,4},{10,9,11,12},{14,13,15,16},{6,5,7,8}}
27 {{2,1,5,6},{4,3,7,8},{12,11,15,16},{10,9,13,14}}
28 {{2,1,5,6},{10,9,13,14},{12,11,15,16},{4,3,7,8}}
29 {{2,1,9,10},{4,3,11,12},{8,7,15,16},{6,5,13,14}}
30 {{2,1,9,10},{6,5,13,14},{8,7,15,16},{4,3,11,12}}
31 {{2,4,3,1},{6,8,7,5},{14,16,15,13},{10,12,11,9}}
32 {{2,4,3,1},{10,12,11,9},{14,16,15,13},{6,8,7,5}}
33 {{2,4,8,6},{1,3,7,5},{9,11,15,13},{10,12,16,14}}
34 {{2,4,8,6},{10,12,16,14},{9,11,15,13},{1,3,7,5}}
35 {{2,4,12,10},{1,3,11,9},{5,7,15,13},{6,8,16,14}}
36 {{2,4,12,10},{6,8,16,14},{5,7,15,13},{1,3,11,9}}
37 {{2,6,5,1},{4,8,7,3},{12,16,15,11},{10,14,13,9}}
38 {{2,6,5,1},{10,14,13,9},{12,16,15,11},{4,8,7,3}}
39 {{2,6,8,4},{1,5,7,3},{9,13,15,11},{10,14,16,12}}
40 {{2,6,8,4},{10,14,16,12},{9,13,15,11},{1,5,7,3}}
41 {{2,6,14,10},{1,5,13,9},{3,7,15,11},{4,8,16,12}}
42 {{2,6,14,10},{4,8,16,12},{3,7,15,11},{1,5,13,9}}
43 {{2,10,9,1},{4,12,11,3},{8,16,15,7},{6,14,13,5}}
44 {{2,10,9,1},{6,14,13,5},{8,16,15,7},{4,12,11,3}}
45 {{2,10,12,4},{1,9,11,3},{5,13,15,7},{6,14,16,8}}
46 {{2,10,12,4},{6,14,16,8},{5,13,15,7},{1,9,11,3}}
47 {{2,10,14,6},{1,9,13,5},{3,11,15,7},{4,12,16,8}}
48 {{2,10,14,6},{4,12,16,8},{3,11,15,7},{1,9,13,5}}
49 {{3,1,2,4},{7,5,6,8},{15,13,14,16},{11,9,10,12}}
50 {{3,1,2,4},{11,9,10,12},{15,13,14,16},{7,5,6,8}}
51 {{3,1,5,7},{4,2,6,8},{12,10,14,16},{11,9,13,15}}
52 {{3,1,5,7},{11,9,13,15},{12,10,14,16},{4,2,6,8}}
53 {{3,1,9,11},{4,2,10,12},{8,6,14,16},{7,5,13,15}}
54 {{3,1,9,11},{7,5,13,15},{8,6,14,16},{4,2,10,12}}
55 {{3,4,2,1},{7,8,6,5},{15,16,14,13},{11,12,10,9}}
56 {{3,4,2,1},{11,12,10,9},{15,16,14,13},{7,8,6,5}}
57 {{3,4,8,7},{1,2,6,5},{9,10,14,13},{11,12,16,15}}
58 {{3,4,8,7},{11,12,16,15},{9,10,14,13},{1,2,6,5}}
59 {{3,4,12,11},{1,2,10,9},{5,6,14,13},{7,8,16,15}}
60 {{3,4,12,11},{7,8,16,15},{5,6,14,13},{1,2,10,9}}
61 {{3,7,5,1},{4,8,6,2},{12,16,14,10},{11,15,13,9}}
62 {{3,7,5,1},{11,15,13,9},{12,16,14,10},{4,8,6,2}}
63 {{3,7,8,4},{1,5,6,2},{9,13,14,10},{11,15,16,12}}
64 {{3,7,8,4},{11,15,16,12},{9,13,14,10},{1,5,6,2}}
65 {{3,7,15,11},{1,5,13,9},{2,6,14,10},{4,8,16,12}}
66 {{3,7,15,11},{4,8,16,12},{2,6,14,10},{1,5,13,9}}
67 {{3,11,9,1},{4,12,10,2},{8,16,14,6},{7,15,13,5}}
68 {{3,11,9,1},{7,15,13,5},{8,16,14,6},{4,12,10,2}}
69 {{3,11,12,4},{1,9,10,2},{5,13,14,6},{7,15,16,8}}
70 {{3,11,12,4},{7,15,16,8},{5,13,14,6},{1,9,10,2}}
71 {{3,11,15,7},{1,9,13,5},{2,10,14,6},{4,12,16,8}}
72 {{3,11,15,7},{4,12,16,8},{2,10,14,6},{1,9,13,5}}
73 {{4,2,1,3},{8,6,5,7},{16,14,13,15},{12,10,9,11}}
74 {{4,2,1,3},{12,10,9,11},{16,14,13,15},{8,6,5,7}}
75 {{4,2,6,8},{3,1,5,7},{11,9,13,15},{12,10,14,16}}
76 {{4,2,6,8},{12,10,14,16},{11,9,13,15},{3,1,5,7}}
77 {{4,2,10,12},{3,1,9,11},{7,5,13,15},{8,6,14,16}}
78 {{4,2,10,12},{8,6,14,16},{7,5,13,15},{3,1,9,11}}
79 {{4,3,1,2},{8,7,5,6},{16,15,13,14},{12,11,9,10}}
80 {{4,3,1,2},{12,11,9,10},{16,15,13,14},{8,7,5,6}}
81 {{4,3,7,8},{2,1,5,6},{10,9,13,14},{12,11,15,16}}
82 {{4,3,7,8},{12,11,15,16},{10,9,13,14},{2,1,5,6}}
83 {{4,3,11,12},{2,1,9,10},{6,5,13,14},{8,7,15,16}}
84 {{4,3,11,12},{8,7,15,16},{6,5,13,14},{2,1,9,10}}
85 {{4,8,6,2},{3,7,5,1},{11,15,13,9},{12,16,14,10}}
86 {{4,8,6,2},{12,16,14,10},{11,15,13,9},{3,7,5,1}}
87 {{4,8,7,3},{2,6,5,1},{10,14,13,9},{12,16,15,11}}
88 {{4,8,7,3},{12,16,15,11},{10,14,13,9},{2,6,5,1}}
89 {{4,8,16,12},{2,6,14,10},{1,5,13,9},{3,7,15,11}}
90 {{4,8,16,12},{3,7,15,11},{1,5,13,9},{2,6,14,10}}
91 {{4,12,10,2},{3,11,9,1},{7,15,13,5},{8,16,14,6}}
92 {{4,12,10,2},{8,16,14,6},{7,15,13,5},{3,11,9,1}}
93 {{4,12,11,3},{2,10,9,1},{6,14,13,5},{8,16,15,7}}
94 {{4,12,11,3},{8,16,15,7},{6,14,13,5},{2,10,9,1}}
95 {{4,12,16,8},{2,10,14,6},{1,9,13,5},{3,11,15,7}}
96 {{4,12,16,8},{3,11,15,7},{1,9,13,5},{2,10,14,6}}
97 {{5,1,2,6},{7,3,4,8},{15,11,12,16},{13,9,10,14}}
98 {{5,1,2,6},{13,9,10,14},{15,11,12,16},{7,3,4,8}}
99 {{5,1,3,7},{6,2,4,8},{14,10,12,16},{13,9,11,15}}
100 {{5,1,3,7},{13,9,11,15},{14,10,12,16},{6,2,4,8}}
101 {{5,1,9,13},{6,2,10,14},{8,4,12,16},{7,3,11,15}}
102 {{5,1,9,13},{7,3,11,15},{8,4,12,16},{6,2,10,14}}
103 {{5,6,2,1},{7,8,4,3},{15,16,12,11},{13,14,10,9}}
104 {{5,6,2,1},{13,14,10,9},{15,16,12,11},{7,8,4,3}}
105 {{5,6,8,7},{1,2,4,3},{9,10,12,11},{13,14,16,15}}
106 {{5,6,8,7},{13,14,16,15},{9,10,12,11},{1,2,4,3}}
107 {{5,6,14,13},{1,2,10,9},{3,4,12,11},{7,8,16,15}}
108 {{5,6,14,13},{7,8,16,15},{3,4,12,11},{1,2,10,9}}
109 {{5,7,3,1},{6,8,4,2},{14,16,12,10},{13,15,11,9}}
110 {{5,7,3,1},{13,15,11,9},{14,16,12,10},{6,8,4,2}}
111 {{5,7,8,6},{1,3,4,2},{9,11,12,10},{13,15,16,14}}
112 {{5,7,8,6},{13,15,16,14},{9,11,12,10},{1,3,4,2}}
113 {{5,7,15,13},{1,3,11,9},{2,4,12,10},{6,8,16,14}}
114 {{5,7,15,13},{6,8,16,14},{2,4,12,10},{1,3,11,9}}
115 {{5,13,9,1},{6,14,10,2},{8,16,12,4},{7,15,11,3}}
116 {{5,13,9,1},{7,15,11,3},{8,16,12,4},{6,14,10,2}}
117 {{5,13,14,6},{1,9,10,2},{3,11,12,4},{7,15,16,8}}
118 {{5,13,14,6},{7,15,16,8},{3,11,12,4},{1,9,10,2}}
119 {{5,13,15,7},{1,9,11,3},{2,10,12,4},{6,14,16,8}}
120 {{5,13,15,7},{6,14,16,8},{2,10,12,4},{1,9,11,3}}
121 {{6,2,1,5},{8,4,3,7},{16,12,11,15},{14,10,9,13}}
122 {{6,2,1,5},{14,10,9,13},{16,12,11,15},{8,4,3,7}}
123 {{6,2,4,8},{5,1,3,7},{13,9,11,15},{14,10,12,16}}
124 {{6,2,4,8},{14,10,12,16},{13,9,11,15},{5,1,3,7}}
125 {{6,2,10,14},{5,1,9,13},{7,3,11,15},{8,4,12,16}}
126 {{6,2,10,14},{8,4,12,16},{7,3,11,15},{5,1,9,13}}
127 {{6,5,1,2},{8,7,3,4},{16,15,11,12},{14,13,9,10}}
128 {{6,5,1,2},{14,13,9,10},{16,15,11,12},{8,7,3,4}}
129 {{6,5,7,8},{2,1,3,4},{10,9,11,12},{14,13,15,16}}
130 {{6,5,7,8},{14,13,15,16},{10,9,11,12},{2,1,3,4}}
131 {{6,5,13,14},{2,1,9,10},{4,3,11,12},{8,7,15,16}}
132 {{6,5,13,14},{8,7,15,16},{4,3,11,12},{2,1,9,10}}
133 {{6,8,4,2},{5,7,3,1},{13,15,11,9},{14,16,12,10}}
134 {{6,8,4,2},{14,16,12,10},{13,15,11,9},{5,7,3,1}}
135 {{6,8,7,5},{2,4,3,1},{10,12,11,9},{14,16,15,13}}
136 {{6,8,7,5},{14,16,15,13},{10,12,11,9},{2,4,3,1}}
137 {{6,8,16,14},{2,4,12,10},{1,3,11,9},{5,7,15,13}}
138 {{6,8,16,14},{5,7,15,13},{1,3,11,9},{2,4,12,10}}
139 {{6,14,10,2},{5,13,9,1},{7,15,11,3},{8,16,12,4}}
140 {{6,14,10,2},{8,16,12,4},{7,15,11,3},{5,13,9,1}}
141 {{6,14,13,5},{2,10,9,1},{4,12,11,3},{8,16,15,7}}
142 {{6,14,13,5},{8,16,15,7},{4,12,11,3},{2,10,9,1}}
143 {{6,14,16,8},{2,10,12,4},{1,9,11,3},{5,13,15,7}}
144 {{6,14,16,8},{5,13,15,7},{1,9,11,3},{2,10,12,4}}
145 {{7,3,1,5},{8,4,2,6},{16,12,10,14},{15,11,9,13}}
146 {{7,3,1,5},{15,11,9,13},{16,12,10,14},{8,4,2,6}}
147 {{7,3,4,8},{5,1,2,6},{13,9,10,14},{15,11,12,16}}
148 {{7,3,4,8},{15,11,12,16},{13,9,10,14},{5,1,2,6}}
149 {{7,3,11,15},{5,1,9,13},{6,2,10,14},{8,4,12,16}}
150 {{7,3,11,15},{8,4,12,16},{6,2,10,14},{5,1,9,13}}
151 {{7,5,1,3},{8,6,2,4},{16,14,10,12},{15,13,9,11}}
152 {{7,5,1,3},{15,13,9,11},{16,14,10,12},{8,6,2,4}}
153 {{7,5,6,8},{3,1,2,4},{11,9,10,12},{15,13,14,16}}
154 {{7,5,6,8},{15,13,14,16},{11,9,10,12},{3,1,2,4}}
155 {{7,5,13,15},{3,1,9,11},{4,2,10,12},{8,6,14,16}}
156 {{7,5,13,15},{8,6,14,16},{4,2,10,12},{3,1,9,11}}
157 {{7,8,4,3},{5,6,2,1},{13,14,10,9},{15,16,12,11}}
158 {{7,8,4,3},{15,16,12,11},{13,14,10,9},{5,6,2,1}}
159 {{7,8,6,5},{3,4,2,1},{11,12,10,9},{15,16,14,13}}
160 {{7,8,6,5},{15,16,14,13},{11,12,10,9},{3,4,2,1}}
161 {{7,8,16,15},{3,4,12,11},{1,2,10,9},{5,6,14,13}}
162 {{7,8,16,15},{5,6,14,13},{1,2,10,9},{3,4,12,11}}
163 {{7,15,11,3},{5,13,9,1},{6,14,10,2},{8,16,12,4}}
164 {{7,15,11,3},{8,16,12,4},{6,14,10,2},{5,13,9,1}}
165 {{7,15,13,5},{3,11,9,1},{4,12,10,2},{8,16,14,6}}
166 {{7,15,13,5},{8,16,14,6},{4,12,10,2},{3,11,9,1}}
167 {{7,15,16,8},{3,11,12,4},{1,9,10,2},{5,13,14,6}}
168 {{7,15,16,8},{5,13,14,6},{1,9,10,2},{3,11,12,4}}
169 {{8,4,2,6},{7,3,1,5},{15,11,9,13},{16,12,10,14}}
170 {{8,4,2,6},{16,12,10,14},{15,11,9,13},{7,3,1,5}}
171 {{8,4,3,7},{6,2,1,5},{14,10,9,13},{16,12,11,15}}
172 {{8,4,3,7},{16,12,11,15},{14,10,9,13},{6,2,1,5}}
173 {{8,4,12,16},{6,2,10,14},{5,1,9,13},{7,3,11,15}}
174 {{8,4,12,16},{7,3,11,15},{5,1,9,13},{6,2,10,14}}
175 {{8,6,2,4},{7,5,1,3},{15,13,9,11},{16,14,10,12}}
176 {{8,6,2,4},{16,14,10,12},{15,13,9,11},{7,5,1,3}}
177 {{8,6,5,7},{4,2,1,3},{12,10,9,11},{16,14,13,15}}
178 {{8,6,5,7},{16,14,13,15},{12,10,9,11},{4,2,1,3}}
179 {{8,6,14,16},{4,2,10,12},{3,1,9,11},{7,5,13,15}}
180 {{8,6,14,16},{7,5,13,15},{3,1,9,11},{4,2,10,12}}
181 {{8,7,3,4},{6,5,1,2},{14,13,9,10},{16,15,11,12}}
182 {{8,7,3,4},{16,15,11,12},{14,13,9,10},{6,5,1,2}}
183 {{8,7,5,6},{4,3,1,2},{12,11,9,10},{16,15,13,14}}
184 {{8,7,5,6},{16,15,13,14},{12,11,9,10},{4,3,1,2}}
185 {{8,7,15,16},{4,3,11,12},{2,1,9,10},{6,5,13,14}}
186 {{8,7,15,16},{6,5,13,14},{2,1,9,10},{4,3,11,12}}
187 {{8,16,12,4},{6,14,10,2},{5,13,9,1},{7,15,11,3}}
188 {{8,16,12,4},{7,15,11,3},{5,13,9,1},{6,14,10,2}}
189 {{8,16,14,6},{4,12,10,2},{3,11,9,1},{7,15,13,5}}
190 {{8,16,14,6},{7,15,13,5},{3,11,9,1},{4,12,10,2}}
191 {{8,16,15,7},{4,12,11,3},{2,10,9,1},{6,14,13,5}}
192 {{8,16,15,7},{6,14,13,5},{2,10,9,1},{4,12,11,3}}
193 {{9,1,2,10},{11,3,4,12},{15,7,8,16},{13,5,6,14}}
194 {{9,1,2,10},{13,5,6,14},{15,7,8,16},{11,3,4,12}}
195 {{9,1,3,11},{10,2,4,12},{14,6,8,16},{13,5,7,15}}
196 {{9,1,3,11},{13,5,7,15},{14,6,8,16},{10,2,4,12}}
197 {{9,1,5,13},{10,2,6,14},{12,4,8,16},{11,3,7,15}}
198 {{9,1,5,13},{11,3,7,15},{12,4,8,16},{10,2,6,14}}
199 {{9,10,2,1},{11,12,4,3},{15,16,8,7},{13,14,6,5}}
200 {{9,10,2,1},{13,14,6,5},{15,16,8,7},{11,12,4,3}}
201 {{9,10,12,11},{1,2,4,3},{5,6,8,7},{13,14,16,15}}
202 {{9,10,12,11},{13,14,16,15},{5,6,8,7},{1,2,4,3}}
203 {{9,10,14,13},{1,2,6,5},{3,4,8,7},{11,12,16,15}}
204 {{9,10,14,13},{11,12,16,15},{3,4,8,7},{1,2,6,5}}
205 {{9,11,3,1},{10,12,4,2},{14,16,8,6},{13,15,7,5}}
206 {{9,11,3,1},{13,15,7,5},{14,16,8,6},{10,12,4,2}}
207 {{9,11,12,10},{1,3,4,2},{5,7,8,6},{13,15,16,14}}
208 {{9,11,12,10},{13,15,16,14},{5,7,8,6},{1,3,4,2}}
209 {{9,11,15,13},{1,3,7,5},{2,4,8,6},{10,12,16,14}}
210 {{9,11,15,13},{10,12,16,14},{2,4,8,6},{1,3,7,5}}
211 {{9,13,5,1},{10,14,6,2},{12,16,8,4},{11,15,7,3}}
212 {{9,13,5,1},{11,15,7,3},{12,16,8,4},{10,14,6,2}}
213 {{9,13,14,10},{1,5,6,2},{3,7,8,4},{11,15,16,12}}
214 {{9,13,14,10},{11,15,16,12},{3,7,8,4},{1,5,6,2}}
215 {{9,13,15,11},{1,5,7,3},{2,6,8,4},{10,14,16,12}}
216 {{9,13,15,11},{10,14,16,12},{2,6,8,4},{1,5,7,3}}
217 {{10,2,1,9},{12,4,3,11},{16,8,7,15},{14,6,5,13}}
218 {{10,2,1,9},{14,6,5,13},{16,8,7,15},{12,4,3,11}}
219 {{10,2,4,12},{9,1,3,11},{13,5,7,15},{14,6,8,16}}
220 {{10,2,4,12},{14,6,8,16},{13,5,7,15},{9,1,3,11}}
221 {{10,2,6,14},{9,1,5,13},{11,3,7,15},{12,4,8,16}}
222 {{10,2,6,14},{12,4,8,16},{11,3,7,15},{9,1,5,13}}
223 {{10,9,1,2},{12,11,3,4},{16,15,7,8},{14,13,5,6}}
224 {{10,9,1,2},{14,13,5,6},{16,15,7,8},{12,11,3,4}}
225 {{10,9,11,12},{2,1,3,4},{6,5,7,8},{14,13,15,16}}
226 {{10,9,11,12},{14,13,15,16},{6,5,7,8},{2,1,3,4}}
227 {{10,9,13,14},{2,1,5,6},{4,3,7,8},{12,11,15,16}}
228 {{10,9,13,14},{12,11,15,16},{4,3,7,8},{2,1,5,6}}
229 {{10,12,4,2},{9,11,3,1},{13,15,7,5},{14,16,8,6}}
230 {{10,12,4,2},{14,16,8,6},{13,15,7,5},{9,11,3,1}}
231 {{10,12,11,9},{2,4,3,1},{6,8,7,5},{14,16,15,13}}
232 {{10,12,11,9},{14,16,15,13},{6,8,7,5},{2,4,3,1}}
233 {{10,12,16,14},{2,4,8,6},{1,3,7,5},{9,11,15,13}}
234 {{10,12,16,14},{9,11,15,13},{1,3,7,5},{2,4,8,6}}
235 {{10,14,6,2},{9,13,5,1},{11,15,7,3},{12,16,8,4}}
236 {{10,14,6,2},{12,16,8,4},{11,15,7,3},{9,13,5,1}}
237 {{10,14,13,9},{2,6,5,1},{4,8,7,3},{12,16,15,11}}
238 {{10,14,13,9},{12,16,15,11},{4,8,7,3},{2,6,5,1}}
239 {{10,14,16,12},{2,6,8,4},{1,5,7,3},{9,13,15,11}}
240 {{10,14,16,12},{9,13,15,11},{1,5,7,3},{2,6,8,4}}
241 {{11,3,1,9},{12,4,2,10},{16,8,6,14},{15,7,5,13}}
242 {{11,3,1,9},{15,7,5,13},{16,8,6,14},{12,4,2,10}}
243 {{11,3,4,12},{9,1,2,10},{13,5,6,14},{15,7,8,16}}
244 {{11,3,4,12},{15,7,8,16},{13,5,6,14},{9,1,2,10}}
245 {{11,3,7,15},{9,1,5,13},{10,2,6,14},{12,4,8,16}}
246 {{11,3,7,15},{12,4,8,16},{10,2,6,14},{9,1,5,13}}
247 {{11,9,1,3},{12,10,2,4},{16,14,6,8},{15,13,5,7}}
248 {{11,9,1,3},{15,13,5,7},{16,14,6,8},{12,10,2,4}}
249 {{11,9,10,12},{3,1,2,4},{7,5,6,8},{15,13,14,16}}
250 {{11,9,10,12},{15,13,14,16},{7,5,6,8},{3,1,2,4}}
251 {{11,9,13,15},{3,1,5,7},{4,2,6,8},{12,10,14,16}}
252 {{11,9,13,15},{12,10,14,16},{4,2,6,8},{3,1,5,7}}
253 {{11,12,4,3},{9,10,2,1},{13,14,6,5},{15,16,8,7}}
254 {{11,12,4,3},{15,16,8,7},{13,14,6,5},{9,10,2,1}}
255 {{11,12,10,9},{3,4,2,1},{7,8,6,5},{15,16,14,13}}
256 {{11,12,10,9},{15,16,14,13},{7,8,6,5},{3,4,2,1}}
257 {{11,12,16,15},{3,4,8,7},{1,2,6,5},{9,10,14,13}}
258 {{11,12,16,15},{9,10,14,13},{1,2,6,5},{3,4,8,7}}
259 {{11,15,7,3},{9,13,5,1},{10,14,6,2},{12,16,8,4}}
260 {{11,15,7,3},{12,16,8,4},{10,14,6,2},{9,13,5,1}}
261 {{11,15,13,9},{3,7,5,1},{4,8,6,2},{12,16,14,10}}
262 {{11,15,13,9},{12,16,14,10},{4,8,6,2},{3,7,5,1}}
263 {{11,15,16,12},{3,7,8,4},{1,5,6,2},{9,13,14,10}}
264 {{11,15,16,12},{9,13,14,10},{1,5,6,2},{3,7,8,4}}
265 {{12,4,2,10},{11,3,1,9},{15,7,5,13},{16,8,6,14}}
266 {{12,4,2,10},{16,8,6,14},{15,7,5,13},{11,3,1,9}}
267 {{12,4,3,11},{10,2,1,9},{14,6,5,13},{16,8,7,15}}
268 {{12,4,3,11},{16,8,7,15},{14,6,5,13},{10,2,1,9}}
269 {{12,4,8,16},{10,2,6,14},{9,1,5,13},{11,3,7,15}}
270 {{12,4,8,16},{11,3,7,15},{9,1,5,13},{10,2,6,14}}
271 {{12,10,2,4},{11,9,1,3},{15,13,5,7},{16,14,6,8}}
272 {{12,10,2,4},{16,14,6,8},{15,13,5,7},{11,9,1,3}}
273 {{12,10,9,11},{4,2,1,3},{8,6,5,7},{16,14,13,15}}
274 {{12,10,9,11},{16,14,13,15},{8,6,5,7},{4,2,1,3}}
275 {{12,10,14,16},{4,2,6,8},{3,1,5,7},{11,9,13,15}}
276 {{12,10,14,16},{11,9,13,15},{3,1,5,7},{4,2,6,8}}
277 {{12,11,3,4},{10,9,1,2},{14,13,5,6},{16,15,7,8}}
278 {{12,11,3,4},{16,15,7,8},{14,13,5,6},{10,9,1,2}}
279 {{12,11,9,10},{4,3,1,2},{8,7,5,6},{16,15,13,14}}
280 {{12,11,9,10},{16,15,13,14},{8,7,5,6},{4,3,1,2}}
281 {{12,11,15,16},{4,3,7,8},{2,1,5,6},{10,9,13,14}}
282 {{12,11,15,16},{10,9,13,14},{2,1,5,6},{4,3,7,8}}
283 {{12,16,8,4},{10,14,6,2},{9,13,5,1},{11,15,7,3}}
284 {{12,16,8,4},{11,15,7,3},{9,13,5,1},{10,14,6,2}}
285 {{12,16,14,10},{4,8,6,2},{3,7,5,1},{11,15,13,9}}
286 {{12,16,14,10},{11,15,13,9},{3,7,5,1},{4,8,6,2}}
287 {{12,16,15,11},{4,8,7,3},{2,6,5,1},{10,14,13,9}}
288 {{12,16,15,11},{10,14,13,9},{2,6,5,1},{4,8,7,3}}
289 {{13,5,1,9},{14,6,2,10},{16,8,4,12},{15,7,3,11}}
290 {{13,5,1,9},{15,7,3,11},{16,8,4,12},{14,6,2,10}}
291 {{13,5,6,14},{9,1,2,10},{11,3,4,12},{15,7,8,16}}
292 {{13,5,6,14},{15,7,8,16},{11,3,4,12},{9,1,2,10}}
293 {{13,5,7,15},{9,1,3,11},{10,2,4,12},{14,6,8,16}}
294 {{13,5,7,15},{14,6,8,16},{10,2,4,12},{9,1,3,11}}
295 {{13,9,1,5},{14,10,2,6},{16,12,4,8},{15,11,3,7}}
296 {{13,9,1,5},{15,11,3,7},{16,12,4,8},{14,10,2,6}}
297 {{13,9,10,14},{5,1,2,6},{7,3,4,8},{15,11,12,16}}
298 {{13,9,10,14},{15,11,12,16},{7,3,4,8},{5,1,2,6}}
299 {{13,9,11,15},{5,1,3,7},{6,2,4,8},{14,10,12,16}}
300 {{13,9,11,15},{14,10,12,16},{6,2,4,8},{5,1,3,7}}
301 {{13,14,6,5},{9,10,2,1},{11,12,4,3},{15,16,8,7}}
302 {{13,14,6,5},{15,16,8,7},{11,12,4,3},{9,10,2,1}}
303 {{13,14,10,9},{5,6,2,1},{7,8,4,3},{15,16,12,11}}
304 {{13,14,10,9},{15,16,12,11},{7,8,4,3},{5,6,2,1}}
305 {{13,14,16,15},{5,6,8,7},{1,2,4,3},{9,10,12,11}}
306 {{13,14,16,15},{9,10,12,11},{1,2,4,3},{5,6,8,7}}
307 {{13,15,7,5},{9,11,3,1},{10,12,4,2},{14,16,8,6}}
308 {{13,15,7,5},{14,16,8,6},{10,12,4,2},{9,11,3,1}}
309 {{13,15,11,9},{5,7,3,1},{6,8,4,2},{14,16,12,10}}
310 {{13,15,11,9},{14,16,12,10},{6,8,4,2},{5,7,3,1}}
311 {{13,15,16,14},{5,7,8,6},{1,3,4,2},{9,11,12,10}}
312 {{13,15,16,14},{9,11,12,10},{1,3,4,2},{5,7,8,6}}
313 {{14,6,2,10},{13,5,1,9},{15,7,3,11},{16,8,4,12}}
314 {{14,6,2,10},{16,8,4,12},{15,7,3,11},{13,5,1,9}}
315 {{14,6,5,13},{10,2,1,9},{12,4,3,11},{16,8,7,15}}
316 {{14,6,5,13},{16,8,7,15},{12,4,3,11},{10,2,1,9}}
317 {{14,6,8,16},{10,2,4,12},{9,1,3,11},{13,5,7,15}}
318 {{14,6,8,16},{13,5,7,15},{9,1,3,11},{10,2,4,12}}
319 {{14,10,2,6},{13,9,1,5},{15,11,3,7},{16,12,4,8}}
320 {{14,10,2,6},{16,12,4,8},{15,11,3,7},{13,9,1,5}}
321 {{14,10,9,13},{6,2,1,5},{8,4,3,7},{16,12,11,15}}
322 {{14,10,9,13},{16,12,11,15},{8,4,3,7},{6,2,1,5}}
323 {{14,10,12,16},{6,2,4,8},{5,1,3,7},{13,9,11,15}}
324 {{14,10,12,16},{13,9,11,15},{5,1,3,7},{6,2,4,8}}
325 {{14,13,5,6},{10,9,1,2},{12,11,3,4},{16,15,7,8}}
326 {{14,13,5,6},{16,15,7,8},{12,11,3,4},{10,9,1,2}}
327 {{14,13,9,10},{6,5,1,2},{8,7,3,4},{16,15,11,12}}
328 {{14,13,9,10},{16,15,11,12},{8,7,3,4},{6,5,1,2}}
329 {{14,13,15,16},{6,5,7,8},{2,1,3,4},{10,9,11,12}}
330 {{14,13,15,16},{10,9,11,12},{2,1,3,4},{6,5,7,8}}
331 {{14,16,8,6},{10,12,4,2},{9,11,3,1},{13,15,7,5}}
332 {{14,16,8,6},{13,15,7,5},{9,11,3,1},{10,12,4,2}}
333 {{14,16,12,10},{6,8,4,2},{5,7,3,1},{13,15,11,9}}
334 {{14,16,12,10},{13,15,11,9},{5,7,3,1},{6,8,4,2}}
335 {{14,16,15,13},{6,8,7,5},{2,4,3,1},{10,12,11,9}}
336 {{14,16,15,13},{10,12,11,9},{2,4,3,1},{6,8,7,5}}
337 {{15,7,3,11},{13,5,1,9},{14,6,2,10},{16,8,4,12}}
338 {{15,7,3,11},{16,8,4,12},{14,6,2,10},{13,5,1,9}}
339 {{15,7,5,13},{11,3,1,9},{12,4,2,10},{16,8,6,14}}
340 {{15,7,5,13},{16,8,6,14},{12,4,2,10},{11,3,1,9}}
341 {{15,7,8,16},{11,3,4,12},{9,1,2,10},{13,5,6,14}}
342 {{15,7,8,16},{13,5,6,14},{9,1,2,10},{11,3,4,12}}
343 {{15,11,3,7},{13,9,1,5},{14,10,2,6},{16,12,4,8}}
344 {{15,11,3,7},{16,12,4,8},{14,10,2,6},{13,9,1,5}}
345 {{15,11,9,13},{7,3,1,5},{8,4,2,6},{16,12,10,14}}
346 {{15,11,9,13},{16,12,10,14},{8,4,2,6},{7,3,1,5}}
347 {{15,11,12,16},{7,3,4,8},{5,1,2,6},{13,9,10,14}}
348 {{15,11,12,16},{13,9,10,14},{5,1,2,6},{7,3,4,8}}
349 {{15,13,5,7},{11,9,1,3},{12,10,2,4},{16,14,6,8}}
350 {{15,13,5,7},{16,14,6,8},{12,10,2,4},{11,9,1,3}}
351 {{15,13,9,11},{7,5,1,3},{8,6,2,4},{16,14,10,12}}
352 {{15,13,9,11},{16,14,10,12},{8,6,2,4},{7,5,1,3}}
353 {{15,13,14,16},{7,5,6,8},{3,1,2,4},{11,9,10,12}}
354 {{15,13,14,16},{11,9,10,12},{3,1,2,4},{7,5,6,8}}
355 {{15,16,8,7},{11,12,4,3},{9,10,2,1},{13,14,6,5}}
356 {{15,16,8,7},{13,14,6,5},{9,10,2,1},{11,12,4,3}}
357 {{15,16,12,11},{7,8,4,3},{5,6,2,1},{13,14,10,9}}
358 {{15,16,12,11},{13,14,10,9},{5,6,2,1},{7,8,4,3}}
359 {{15,16,14,13},{7,8,6,5},{3,4,2,1},{11,12,10,9}}
360 {{15,16,14,13},{11,12,10,9},{3,4,2,1},{7,8,6,5}}
361 {{16,8,4,12},{14,6,2,10},{13,5,1,9},{15,7,3,11}}
362 {{16,8,4,12},{15,7,3,11},{13,5,1,9},{14,6,2,10}}
363 {{16,8,6,14},{12,4,2,10},{11,3,1,9},{15,7,5,13}}
364 {{16,8,6,14},{15,7,5,13},{11,3,1,9},{12,4,2,10}}
365 {{16,8,7,15},{12,4,3,11},{10,2,1,9},{14,6,5,13}}
366 {{16,8,7,15},{14,6,5,13},{10,2,1,9},{12,4,3,11}}
367 {{16,12,4,8},{14,10,2,6},{13,9,1,5},{15,11,3,7}}
368 {{16,12,4,8},{15,11,3,7},{13,9,1,5},{14,10,2,6}}
369 {{16,12,10,14},{8,4,2,6},{7,3,1,5},{15,11,9,13}}
370 {{16,12,10,14},{15,11,9,13},{7,3,1,5},{8,4,2,6}}
371 {{16,12,11,15},{8,4,3,7},{6,2,1,5},{14,10,9,13}}
372 {{16,12,11,15},{14,10,9,13},{6,2,1,5},{8,4,3,7}}
373 {{16,14,6,8},{12,10,2,4},{11,9,1,3},{15,13,5,7}}
374 {{16,14,6,8},{15,13,5,7},{11,9,1,3},{12,10,2,4}}
375 {{16,14,10,12},{8,6,2,4},{7,5,1,3},{15,13,9,11}}
376 {{16,14,10,12},{15,13,9,11},{7,5,1,3},{8,6,2,4}}
377 {{16,14,13,15},{8,6,5,7},{4,2,1,3},{12,10,9,11}}
378 {{16,14,13,15},{12,10,9,11},{4,2,1,3},{8,6,5,7}}
379 {{16,15,7,8},{12,11,3,4},{10,9,1,2},{14,13,5,6}}
380 {{16,15,7,8},{14,13,5,6},{10,9,1,2},{12,11,3,4}}
381 {{16,15,11,12},{8,7,3,4},{6,5,1,2},{14,13,9,10}}
382 {{16,15,11,12},{14,13,9,10},{6,5,1,2},{8,7,3,4}}
383 {{16,15,13,14},{8,7,5,6},{4,3,1,2},{12,11,9,10}}
384 {{16,15,13,14},{12,11,9,10},{4,3,1,2},{8,7,5,6}}
去掉旋转和翻转相同的,得解48个,清单如下:
1 {{1,2,4,3},{5,6,8,7},{13,14,16,15},{9,10,12,11}}
2 {{1,2,4,3},{9,10,12,11},{13,14,16,15},{5,6,8,7}}
3 {{1,2,6,5},{3,4,8,7},{11,12,16,15},{9,10,14,13}}
4 {{1,2,6,5},{9,10,14,13},{11,12,16,15},{3,4,8,7}}
5 {{1,2,10,9},{3,4,12,11},{7,8,16,15},{5,6,14,13}}
6 {{1,2,10,9},{5,6,14,13},{7,8,16,15},{3,4,12,11}}
7 {{1,3,4,2},{5,7,8,6},{13,15,16,14},{9,11,12,10}}
8 {{1,3,4,2},{9,11,12,10},{13,15,16,14},{5,7,8,6}}
9 {{1,3,7,5},{9,11,15,13},{10,12,16,14},{2,4,8,6}}
10 {{1,3,11,9},{5,7,15,13},{6,8,16,14},{2,4,12,10}}
11 {{1,5,6,2},{9,13,14,10},{11,15,16,12},{3,7,8,4}}
12 {{1,5,7,3},{9,13,15,11},{10,14,16,12},{2,6,8,4}}
13 {{2,1,3,4},{6,5,7,8},{14,13,15,16},{10,9,11,12}}
14 {{2,1,3,4},{10,9,11,12},{14,13,15,16},{6,5,7,8}}
15 {{2,1,5,6},{4,3,7,8},{12,11,15,16},{10,9,13,14}}
16 {{2,1,5,6},{10,9,13,14},{12,11,15,16},{4,3,7,8}}
17 {{2,1,9,10},{4,3,11,12},{8,7,15,16},{6,5,13,14}}
18 {{2,1,9,10},{6,5,13,14},{8,7,15,16},{4,3,11,12}}
19 {{3,1,2,4},{7,5,6,8},{15,13,14,16},{11,9,10,12}}
20 {{3,1,2,4},{11,9,10,12},{15,13,14,16},{7,5,6,8}}
21 {{3,1,5,7},{4,2,6,8},{12,10,14,16},{11,9,13,15}}
22 {{3,1,5,7},{11,9,13,15},{12,10,14,16},{4,2,6,8}}
23 {{3,1,9,11},{4,2,10,12},{8,6,14,16},{7,5,13,15}}
24 {{3,1,9,11},{7,5,13,15},{8,6,14,16},{4,2,10,12}}
25 {{4,2,6,8},{3,1,5,7},{11,9,13,15},{12,10,14,16}}
26 {{4,2,10,12},{3,1,9,11},{7,5,13,15},{8,6,14,16}}
27 {{5,1,2,6},{7,3,4,8},{15,11,12,16},{13,9,10,14}}
28 {{5,1,2,6},{13,9,10,14},{15,11,12,16},{7,3,4,8}}
29 {{5,1,3,7},{6,2,4,8},{14,10,12,16},{13,9,11,15}}
30 {{5,1,3,7},{13,9,11,15},{14,10,12,16},{6,2,4,8}}
31 {{5,1,9,13},{6,2,10,14},{8,4,12,16},{7,3,11,15}}
32 {{5,1,9,13},{7,3,11,15},{8,4,12,16},{6,2,10,14}}
33 {{6,2,4,8},{5,1,3,7},{13,9,11,15},{14,10,12,16}}
34 {{6,2,10,14},{5,1,9,13},{7,3,11,15},{8,4,12,16}}
35 {{7,3,4,8},{5,1,2,6},{13,9,10,14},{15,11,12,16}}
36 {{7,3,11,15},{5,1,9,13},{6,2,10,14},{8,4,12,16}}
37 {{9,1,2,10},{11,3,4,12},{15,7,8,16},{13,5,6,14}}
38 {{9,1,2,10},{13,5,6,14},{15,7,8,16},{11,3,4,12}}
39 {{9,1,3,11},{10,2,4,12},{14,6,8,16},{13,5,7,15}}
40 {{9,1,3,11},{13,5,7,15},{14,6,8,16},{10,2,4,12}}
41 {{9,1,5,13},{10,2,6,14},{12,4,8,16},{11,3,7,15}}
42 {{9,1,5,13},{11,3,7,15},{12,4,8,16},{10,2,6,14}}
43 {{10,2,4,12},{9,1,3,11},{13,5,7,15},{14,6,8,16}}
44 {{10,2,6,14},{9,1,5,13},{11,3,7,15},{12,4,8,16}}
45 {{11,3,4,12},{9,1,2,10},{13,5,6,14},{15,7,8,16}}
46 {{11,3,7,15},{9,1,5,13},{10,2,6,14},{12,4,8,16}}
47 {{13,5,6,14},{9,1,2,10},{11,3,4,12},{15,7,8,16}}
48 {{13,5,7,15},{9,1,3,11},{10,2,4,12},{14,6,8,16}}
dlpg070
发表于 2020-1-18 10:55:26
chyanog 发表于 2020-1-12 10:14
Mathematica代码,计算5×5的把n=4改成n=5即可。ans表示搜到的所有结果,ans2表示去重后的结果。计算5 ...
我想把这段代码推广,遇到麻烦,请帮助修改
1 n=4,5,6,7,正确 n=8 出错
Compile::initvar: The variable i10 has not been initialized or has been initialized to Null.
2 改eqn 求解普通幻方
n=4 正确,n=5 出错
Compile::initvar: The variable i10 has not been initialized or has been initialized to Null.
出错原因相同,都在cf,无力改进