mathe 发表于 2019-5-11 19:29:22

中心为4的已经找到人肉解

A=2的根据王守恩有 V组只有三解。容易验证这三组各可导致一个唯一解。

A=2时,V=32=1+3+4+5+7+12, R=19+17+16+15+13+8, E=6+9+10+11+14+18,其中
          6+4+12, 9+1+12, 10+5+7,11+7+4,14+7+1或14+5+3,18+1+3。由于7只能使用两次,淘汰方案14+7+1,得到合法解
          4+6+12,12+9+1,1+18+3,3+14+5,5+10+7,7+11+4.

A=2时,V=32=1+3+4+5+8+11, R=19+17+16+15+12+9, E=6+7+10+13+14+18,其中
      6+11+5, 7+11+4, 10+8+4或10+11+1,13+8+1或13+5+4, 14+5+3, 18+3+1
       其中确定的方案6+11+5,7+11+4,18+3+1 已经使用了两个11,所以淘汰10+11+1,也就是还要使用10+8+4,所以4也使用了两次,淘汰13+5+4, 只能是13+8+1
也就是确定方案6+11+5, 7+11+4, 10+8+4, 13+8+1, 14+5+3, 18+3+1, 这又是一个合法的解。

A=2时,V=32=1+3+4+7+8+9, R=19+17=16+13+12+11, E=5+6+10+14+15+18,
      其中5+8+9, 6+7+9, 10+9+3或10+8+4,14+7+1,15+4+3,18+3+1,其中10+9+3由于9已经被使用两次淘汰,所以得到解
      5+8+9,6+7+9,10+8+4,14+7+1,15+4+3,18+3+1


所以所有解是四组。

northwolves 发表于 2019-5-11 22:24:42

如果每个小三角形的每边上的三个数加起来都是S,当S=23,24,25,...呢?

zeroieme 发表于 2019-5-11 23:54:41

本帖最后由 zeroieme 于 2019-5-12 09:23 编辑

S=22

{{{{2,19,1},{2,17,3},{1,18,3}},{{2,17,3},{2,15,5},{3,14,5}},{{2,15,5},{2,9,11},{5,6,11}},{{2,9,11},{2,16,4},{11,7,4}},{{2,16,4},{2,12,8},{4,10,8}},{{2,12,8},{2,19,1},{8,13,1}}},{{{2,19,1},{2,17,3},{1,18,3}},{{2,17,3},{2,15,5},{3,14,5}},{{2,15,5},{2,13,7},{5,10,7}},{{2,13,7},{2,16,4},{7,11,4}},{{2,16,4},{2,8,12},{4,6,12}},{{2,8,12},{2,19,1},{12,9,1}}},{{{2,19,1},{2,17,3},{1,18,3}},{{2,17,3},{2,16,4},{3,15,4}},{{2,16,4},{2,12,8},{4,10,8}},{{2,12,8},{2,11,9},{8,5,9}},{{2,11,9},{2,13,7},{9,6,7}},{{2,13,7},{2,19,1},{7,14,1}}},{{{4,17,1},{4,16,2},{1,19,2}},{{4,16,2},{4,12,6},{2,14,6}},{{4,12,6},{4,13,5},{6,11,5}},{{4,13,5},{4,8,10},{5,7,10}},{{4,8,10},{4,15,3},{10,9,3}},{{4,15,3},{4,17,1},{3,18,1}}}}

zeroieme 发表于 2019-5-11 23:57:12

本帖最后由 zeroieme 于 2019-5-12 09:27 编辑

northwolves 发表于 2019-5-11 22:24
如果每个小三角形的每边上的三个数加起来都是S,当S=23,24,25,...呢?

S=23
{{{{6,16,1},{6,14,3},{1,19,3}},{{6,14,3},{6,9,8},{3,12,8}},{{6,9,8},{6,7,10},{8,5,10}},{{6,7,10},{6,15,2},{10,11,2}},{{6,15,2},{6,13,4},{2,17,4}},{{6,13,4},{6,16,1},{4,18,1}}}}


zeroieme 发表于 2019-5-12 06:58:20

本帖最后由 zeroieme 于 2019-5-12 09:34 编辑

所有等和六边形,分文件保存

19//Range//Subsets[#,{3}]&//(*先组边,按和分类*)GatherBy[#,Total]&//Parallelize[(Subsets[#,{3}]//Select[#,(*再组三角形*)({#//Flatten//Union//Length[#]==6&,Subsets[#,{2}]//Intersection@@#&/@#&//{Length[#]==1&/@#,#//Flatten//Union//Length[#]==3&}&}//Flatten//And@@#&)&]&//Subsets[#,{3}]&//Select[#,(*只有一个公共点的三角形组*)(Union@@#&/@#//Subsets[#,{2}]&//Intersection@@#&/@#&//#[]==#[]==#[]\Length[#[]]==1&)\((#//Flatten//Tally//Select[#,#[]==2&][]&)&/@#//Intersection@@#&//Length[#]==1&)\(#//Flatten//Union//Length[#]==16&)&]&//(#~Function[{Triangles,\Point},(*公共数字置前*)(AppendPoint]&]//PrependPoint}],\Point]&/@#&,Select[#,NotPoint]]&]//First]//Function[{a,b,c},Append[({#\c,#//Reverse}//Flatten//DeleteDuplicates//Reverse)&/@{a,b},{a\c,Complement,b\c}//Flatten]]@@#&)&/@Triangles]~(Flatten/@#//Intersection@@#&//First))&/@#&//GatherBy[#,(*按公共数字分类*)#[]&]&//(Subsets[#,{2}]//Select[#,(*三角形组配对成六边形*)(#[]\#[]=={})\(#//Flatten//Union//Length[#]==19&)\(#[]//Flatten[#,2]&//Union//Length[#]==6&)&]&)&/@#&//Join@@#&//Quiet]},#[]}&//Nest,\},Select[\,MemberQ[#,\[[-1,2]]]&]//First//{Append[\,Prepend[#,\[[-1,2]]]//DeleteDuplicates],Complement[\,{#}]}&]@@#&,#,5]&//First),{}]]&/@#&//Complement[#,{{}}]&//GatherBy[#,(#[]//Union@@#&)&]&//(#[]//Function[{a,b,c},Append[({#\c,#//Reverse}//Flatten//DeleteDuplicates//Reverse)&/@{a,b},{a\c,Complement,b\c}//Flatten]]@@#&/@#&)&/@#&(*输出格式:每组数据为六个三角形组成的六边形,每个三角形前两条为中心公共边,第三条三角形边为六边形的边*)//If[#!={},(#//ToString[#,InputForm]&//StringReplace[#,{" "->"","\n"->""}]&//StringReplace[#,{"}}},{{{"->"}}},\n{{{"}]&)~Function[{s1,s2},OpenWrite//Function[{s3},WriteString;Close];s2]~("Hexagons-S="<>ToString]]]<>".txt")]&)&/@#,Method->"FinestGrained"]&//DeleteCases[#,Null]&

northwolves 发表于 2019-5-12 08:39:04

zeroieme 发表于 2019-5-12 08:14
加个字符图输出函数




$8+5+4<>22$

中间的数字只能是偶数

zeroieme 发表于 2019-5-12 09:22:19

northwolves 发表于 2019-5-12 08:39
$8+5+422$

中间的数字只能是偶数

把{a,b,c}和{a,c,b}混淆了,要大修改:L

zeroieme 发表于 2019-5-12 09:47:43

{{{2, 19, 1}, {2, 17, 3}, {1, 18, 3}}, {{2, 17, 3}, {2, 15, 5}, {3,
    14, 5}}, {{2, 15, 5}, {2, 9, 11}, {5, 6, 11}}, {{2, 9, 11}, {2,
    16, 4}, {11, 7, 4}}, {{2, 16, 4}, {2, 12, 8}, {4, 10, 8}}, {{2,
    12, 8}, {2, 19, 1}, {8, 13,
    1}}} // (Map <> ToString[#] &, #, {-1}] //
    StringReplace[
      "  #1━#2━#3\n / \  / \\n #4  #5 #6 #7\n/   \ /  \\n\
#8━#9━#a━#b━#c\n\  /  \  /\n #d #e  #f #g\n \ /  \ /\n  #h━#i━#j\n", \
{"#a" -> #[], "#b" -> #[], "#c" -> #[],
       "#7" -> #[], "#6" -> #[],
       "#3" -> #[], "#2" -> #[],
       "#5" -> #[], "#1" -> #[],
       "#4" -> #[], "#9" -> #[],
       "#8" -> #[], "#d" -> #[],
       "#e" -> #[], "#h" -> #[],
       "#i" -> #[], "#f" -> #[],
       "#j" -> #[], "#g" -> #[]}] &) &

   5━14━ 3
 / \  / \
  6  15 17 18
/   \ /  \
11━ 9━ 2━19━ 1
\  /  \  /
  7 16  12 13
 \ /  \ /
   4━10━ 8

northwolves 发表于 2019-5-12 11:00:38

sum=有解

wayne 发表于 2019-5-12 14:19:48

受到mathe的手工求解的启发。我也写了一个程序, 耗时的地方主要是整数的拆分

Flatten],k,S-2MovingAverage],2],S-s[]-k};{S,s[],k},Union]},{k,Flatten,{c,Flatten,#]]&/@Subsets,{2}]},{cc,Permutations]}],1]}],{t,s[]}],{s,Table[{2i,Select/2-5i,{6}],Length]==6 &&Not@MemberQ[#,2i]&&Max[#]<20&]},{i,(6S-Binomial/2-Binomial)/5}]}],2],Length]==19&&Min]==1&][],{S,22,31}],1]

{22,4}
{23,2}
{24,6}
{25,8}
{26,3}
{27,7}
{28,1}
{29,4}
{30,0}
{31,4}
{32,3}
{33,8}
{34,3}
{35,6}
{36,4}
{37,1}
{38,6}


数据结构是中心数A,六个顶点的数【按照逆(顺)时针排列】。
为了消除旋转对称性,约定六个顶点中最大的数字是1号位。为了消除纸内纸外的翻转对称性,约定2号位比3号位要大。计算结果如下:

{22,2,{11,5,3,1,8,4}}
{22,2,{9,8,4,3,1,7}}
{22,2,{9,7,1,3,4,8}}
{22,4,{10,3,1,2,6,5}}
{23,6,{10,8,4,2,3,1}}
{23,6,{10,8,3,1,4,2}}
{24,2,{15,8,4,9,5,3}}
{24,4,{12,11,6,5,3,2}}
{24,4,{12,11,3,2,6,5}}
{24,6,{13,3,2,4,11,1}}
{24,8,{12,5,1,6,2,3}}
{24,8,{12,3,2,6,1,5}}
{25,2,{16,8,4,11,5,6}}
{25,2,{16,6,5,11,4,8}}
{25,4,{16,8,3,10,6,2}}
{25,4,{14,10,6,2,5,8}}
{25,4,{14,8,5,2,6,10}}
{25,8,{14,7,5,1,6,2}}
{25,8,{12,10,1,6,2,4}}
{25,8,{12,4,2,6,1,10}}
{26,4,{16,8,3,5,10,9}}
{26,8,{14,11,6,3,5,2}}
{26,8,{14,11,5,2,6,3}}
{27,2,{17,7,6,10,13,9}}
{27,6,{19,7,4,10,9,3}}
{27,6,{19,5,4,8,9,7}}
{27,8,{18,6,2,9,7,5}}
{27,8,{17,9,7,5,3,6}}
{27,8,{17,6,3,5,7,9}}
{27,8,{15,9,2,6,14,1}}
{28,4,{16,11,5,6,15,10}}
{29,4,{18,10,6,11,16,8}}
{29,10,{18,7,3,11,13,2}}
{29,12,{16,11,3,7,4,8}}
{29,12,{16,8,4,7,3,11}}
{31,8,{17,9,4,12,16,13}}
{31,10,{19,8,6,14,16,3}}
{31,16,{14,10,2,12,4,9}}
{31,16,{14,9,4,12,2,10}}
{32,16,{15,14,10,5,9,4}}
{32,16,{15,14,5,10,4,9}}
{32,16,{15,9,4,10,5,14}}
{33,12,{18,14,2,15,13,11}}
{33,12,{17,15,13,11,3,14}}
{33,12,{17,14,3,11,13,15}}
{33,14,{17,11,10,16,13,1}}
{33,14,{16,15,1,13,11,12}}
{33,14,{16,12,11,13,1,15}}
{33,18,{14,13,3,11,7,10}}
{33,18,{14,10,7,11,3,13}}
{34,12,{18,15,9,6,17,14}}
{34,16,{17,15,10,11,4,12}}
{34,16,{17,12,4,11,10,15}}
{35,12,{19,10,8,16,18,14}}
{35,12,{19,15,13,6,18,14}}
{35,16,{18,14,10,17,12,4}}
{35,16,{18,15,12,6,10,14}}
{35,16,{18,14,10,6,12,15}}
{35,18,{16,12,4,14,15,9}}
{36,12,{19,15,8,17,18,14}}
{36,16,{18,17,15,14,9,8}}
{36,16,{18,17,9,8,15,14}}
{36,18,{17,15,11,16,12,5}}
{37,14,{19,17,12,10,18,16}}
{38,16,{19,18,14,15,10,17}}
{38,16,{19,17,10,15,14,18}}
{38,18,{19,17,15,13,16,8}}
{38,18,{19,17,15,9,16,12}}
{38,18,{19,17,16,12,11,13}}
{38,18,{19,13,11,12,16,17}}
页: 1 [2] 3 4 5
查看完整版本: 六边形上19个黑点上不同数字求所有的解!