女王的数字问题
版主: verdelite, TheMatrix
Re: 女王的数字问题
女王为啥要大毁子民的人生?
两乘数中小者在2与31426之间
单位数:8个
2位:9*8
3: 9*8*7
4: 9 *8*7*6
5: 2*8*7*6*5 + 2*6*5 + 5 + 2
共7035个
用它们去除123456789等共362880个数
2552860800次运算
25.5亿
把女王推翻,行不?
两乘数中小者在2与31426之间
单位数:8个
2位:9*8
3: 9*8*7
4: 9 *8*7*6
5: 2*8*7*6*5 + 2*6*5 + 5 + 2
共7035个
用它们去除123456789等共362880个数
2552860800次运算
25.5亿
把女王推翻,行不?
-
- 论坛支柱
2024年度优秀版主
TheMatrix 的博客 - 帖子互动: 274
- 帖子: 13572
- 注册时间: 2022年 7月 26日 00:35
Re: 女王的数字问题
给出一个例子?长啥样?meiyoumajia 写了: 2023年 2月 4日 22:44 女王为啥要大毁子民的人生?
两乘数中小者在2与31426之间
单位数:8个
2位:9*8
3: 9*8*7
4: 9 *8*7*6
5: 2*8*7*6*5 + 2*6*5 + 5 + 2
共7035个
用它们去除123456789等共362880个数
2552860800次运算
25.5亿
把女王推翻,行不?
-
- 论坛元老
Caravel 的博客 - 帖子互动: 677
- 帖子: 26999
- 注册时间: 2022年 7月 24日 17:21
Re: 女王的数字问题
为啥要“除123456789等共362880个数”, 乘完检查一下数字不就行了。meiyoumajia 写了: 2023年 2月 4日 22:44 女王为啥要大毁子民的人生?
两乘数中小者在2与31426之间
单位数:8个
2位:9*8
3: 9*8*7
4: 9 *8*7*6
5: 2*8*7*6*5 + 2*6*5 + 5 + 2
共7035个
用它们去除123456789等共362880个数
2552860800次运算
25.5亿
把女王推翻,行不?
-
- 论坛元老
Caravel 的博客 - 帖子互动: 677
- 帖子: 26999
- 注册时间: 2022年 7月 24日 17:21
Re: 女王的数字问题
有很多解 1279个,而且似乎有些数字,排列组合之后还是成立
9 * 85347261 = 768125349
9 * 85372461 = 768352149
9 * 85436127 = 768925143
9 * 85461372 = 769152348
9 * 85473126 = 769258134
9861 * 23475 = 231486975
9864 * 13752 = 135649728
9864 * 17532 = 172935648
9864 * 25137 = 247951368
9864 * 52137 = 514279368
9 * 87146325 = 784316925
9 * 87325146 = 785926314
9873 * 54612 = 539184276
我的很笨的code
import itertools a = "123456789" def test_num(x): if x > 987654321 or x < 1234567: return False x = str(x) if "0" in x: return False b = set([c for c in x]) return len(b) == 9 sol = [] for s in itertools.permutations(a): s1 = "".join(s) for i in range(1, 4): c = int(s1[0:i]) d = int(s1[i:]) if (c > d): continue e = c * d if (test_num(e)): print ("{} * {} = {}".format(c, d, e)) sol.append((c, d, e))
Re: 女王的数字问题
你这个check的逻辑很好,比我的好(我用的是看是不是在那个permutation 后的set 里面)Caravel 写了: 2023年 2月 5日 07:34 有很多解 1279个,而且似乎有些数字,排列组合之后还是成立
9 * 85347261 = 768125349
9 * 85372461 = 768352149
9 * 85436127 = 768925143
9 * 85461372 = 769152348
9 * 85473126 = 769258134
9861 * 23475 = 231486975
9864 * 13752 = 135649728
9864 * 17532 = 172935648
9864 * 25137 = 247951368
9864 * 52137 = 514279368
9 * 87146325 = 784316925
9 * 87325146 = 785926314
9873 * 54612 = 539184276
我的很笨的code
import itertools
a = "123456789"
def test_num(x):
if x > 987654321 or x < 1234567:
return False
x = str(x)
if "0" in x:
return False
b = set([c for c in x])
return len(b) == 9
sol = []
for s in itertools.permutations(a):
s1 = "".join(s)
for i in range(1, 4):
c = int(s1[0:i])
d = int(s1[i:])
if (c > d):
continue
e = c * d
if (test_num(e)):
print ("{} * {} = {}".format(c, d, e))
sol.append((c, d, e))
量变导致质变,解多了就发生质变,里面就有结构了。有人研究一下这些解的结构吗?
我觉得还可以引入或者不引入0。
另外一个方向是看看别的进制的规律,因为可以直到无穷进制,说不定可以发现些定律或者猜想。
-
- 论坛支柱
2024年度优秀版主
TheMatrix 的博客 - 帖子互动: 274
- 帖子: 13572
- 注册时间: 2022年 7月 26日 00:35
Re: 女王的数字问题
哦。不错。运行还挺快的。Caravel 写了: 2023年 2月 5日 07:34 有很多解 1279个,而且似乎有些数字,排列组合之后还是成立
9 * 85347261 = 768125349
9 * 85372461 = 768352149
9 * 85436127 = 768925143
9 * 85461372 = 769152348
9 * 85473126 = 769258134
9861 * 23475 = 231486975
9864 * 13752 = 135649728
9864 * 17532 = 172935648
9864 * 25137 = 247951368
9864 * 52137 = 514279368
9 * 87146325 = 784316925
9 * 87325146 = 785926314
9873 * 54612 = 539184276
我的很笨的code
import itertools
a = "123456789"
def test_num(x):
if x > 987654321 or x < 1234567:
return False
x = str(x)
if "0" in x:
return False
b = set([c for c in x])
return len(b) == 9
sol = []
for s in itertools.permutations(a):
s1 = "".join(s)
for i in range(1, 4):
c = int(s1[0:i])
d = int(s1[i:])
if (c > d):
continue
e = c * d
if (test_num(e)):
print ("{} * {} = {}".format(c, d, e))
sol.append((c, d, e))
-
- 论坛元老
Caravel 的博客 - 帖子互动: 677
- 帖子: 26999
- 注册时间: 2022年 7月 24日 17:21
-
- 论坛元老
Caravel 的博客 - 帖子互动: 677
- 帖子: 26999
- 注册时间: 2022年 7月 24日 17:21
Re: 女王的数字问题
算了多久?Caravel 写了: 2023年 2月 5日 07:34 有很多解 1279个,而且似乎有些数字,排列组合之后还是成立
9 * 85347261 = 768125349
9 * 85372461 = 768352149
9 * 85436127 = 768925143
9 * 85461372 = 769152348
9 * 85473126 = 769258134
9861 * 23475 = 231486975
9864 * 13752 = 135649728
9864 * 17532 = 172935648
9864 * 25137 = 247951368
9864 * 52137 = 514279368
9 * 87146325 = 784316925
9 * 87325146 = 785926314
9873 * 54612 = 539184276
我的很笨的code
import itertools
a = "123456789"
def test_num(x):
if x > 987654321 or x < 1234567:
return False
x = str(x)
if "0" in x:
return False
b = set([c for c in x])
return len(b) == 9
sol = []
for s in itertools.permutations(a):
s1 = "".join(s)
for i in range(1, 4):
c = int(s1[0:i])
d = int(s1[i:])
if (c > d):
continue
e = c * d
if (test_num(e)):
print ("{} * {} = {}".format(c, d, e))
sol.append((c, d, e))