找回密码
 注册
Simdroid-非首页
查看: 65|回复: 2

[欧拉习题] PE[46]:the smallest odd composite that cannot be written as....

[复制链接]
发表于 2009-11-21 23:23:26 | 显示全部楼层 |阅读模式 来自 甘肃兰州
It was proposed by Christian Goldbach that every odd composite number can be written as the sum of a prime and twice a square.

9 = 7 + 2×1^(2)
15 = 7 + 2×2^(2)
21 = 3 + 2×3^(2)
25 = 7 + 2×3^(2)
27 = 19 + 2×2^(2)
33 = 31 + 2×1^(2)

It turns out that the conjecture was false.

What is the smallest odd composite that cannot be written as the sum of a prime and twice a square?


有人假设所有奇数都可以表示为一个素数和一个平方的2倍之和。现在知道这个假设是不成立的。要求找出最小的一个不能写成这种形式的数。
 楼主| 发表于 2009-11-21 23:24:26 | 显示全部楼层 来自 甘肃兰州
Simdroid开发平台
  1. In[27]:= Timing[s = 3;
  2. While[Or @@ (PrimeQ[s - 2 #^2] & /@ Range[0, Sqrt[s/2], 1]) == True,
  3.   s += 2]; s]

  4. Out[27]= {0.703, 5777}
复制代码
这种写法是否比较简练?
回复 不支持

使用道具 举报

发表于 2009-11-21 23:41:34 | 显示全部楼层 来自 上海
还可以把 Range 里面的 1 省掉。
回复 不支持

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|小黑屋|联系我们|仿真互动网 ( 京ICP备15048925号-7 )

GMT+8, 2024-4-25 00:06 , Processed in 0.035808 second(s), 14 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表