- 注册时间
- 2017-1-14
- 最后登录
- 1970-1-1
- 威望
- 星
- 金币
- 枚
- 贡献
- 分
- 经验
- 点
- 鲜花
- 朵
- 魅力
- 点
- 上传
- 次
- 下载
- 次
- 积分
- 10773
- 在线时间
- 小时
|
楼主 |
发表于 2025-11-2 07:25:24
|
显示全部楼层
A × B = C。 A是 n 位数。 B是 n 位数。A,B数码集合 = (1到n的个位数) + (1到n的个位数) = C数码集合。
我们先解决有解无解。不考虑解多解少。
a(8)。 26874138*55314672 = 1486534128752736。
a(9)。 438976458*722693151 = 317245279646839158。
a(10)。3294118752*4636905807 = 15274518370096392864。
a(18)。530266101869715174*743258583239784642 = 394124831615767818242403625639557708。
a(19)。2719240316162486139*4973725468095587538 = 13524754814369654822793601709986135782。
a(20)。68396562105750043848*72198252194377943160 = 4938112240139375376079845628254051679680。
a(28)。2762024385746531564097381759*8011056265461241833832497789 = 22126732760791489581354387696848374129551706342056430851。
a(29)。51979181780748962410454023986*83756920135867393322672165454 = 4353616177137924320291099104558238856282135984870676579644。
a(30)。513387207682020534415488991293*664609577742013364917550128968 = 341202055315698987360953278429271514883041846109676379075624。
a(38)。23642139045382948650478753545631341114*52262816048973329678066708158571797902 = 1235604763933098964621651880044735474812956385317280299577751670126431542828。
a(39)。738246764031486232096941136215799598283*963875707054403057516579941258182468123 = 711578121661473843388239195484300712064952776440479755226698921935656853032809。
a(40)。3394446539276422977411930780606551111049*4898673596284892781513020523358787620560 = 16628285635954043501047236340197181889372901674729697817214836925308295035567440。
a(48)。
a(49)。
a(50)。
a(58)。
a(59)。
a(60)。
a(68)。
a(69)。
a(70)。
直觉: 个位 = 8, 9, 0 的有解。用的是这个代码——罢工了。
- m = 50; n = 50; s = Join[Range[0, 9], Range[0, 9],
- {1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 0, 0,
- 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 0, 0}];
- v = Sort[s]; Print["=== 寻找 m=", m, ", n=", n, " 的解 ==="]; Print["数字集合: ", v]; \Print["数字统计: ", Tally[v]]; Print["搜索中..."]; found = False;
- maxAttempts = 20000000; Do[perm = RandomSample[s]; If[perm[[1]] != 0 && perm[[m + 1]] != 0, r = Partition[perm, UpTo[m]];
- f1 = FromDigits[r[[1]]]; f2 = FromDigits[r[[2]]]; product = f1*f2; If[Sort[IntegerDigits[product]] == v, Print["*** 找到解 ***"];
- Print["因子1: ", f1, " (数字: ", IntegerDigits[f1], ")"];
- Print["因子2: ", f2, " (数字: ", IntegerDigits[f2], ")"];
- Print["乘积: ", product, " (数字: ", IntegerDigits[product], ")"];
- Print["验证: 合并数字 = ", Sort[Join[IntegerDigits[f1], IntegerDigits[f2], IntegerDigits[product]]]]; found = True; Break[];]], {maxAttempts}];
- If[! found, Print["在 ", maxAttempts, " 次尝试中未找到解"]; Print["可能这个组合无解,或者需要更多尝试"];];
复制代码 |
|