liangbch
发表于 2013-10-24 14:02:58
mathematica 发表于 2013-10-24 12:59
前六个素数1381207
(*计算小于等于m的Pn的光滑数的个数的子函数*)
Clear["Global`*"];(*Clear all variab ...
我的计算结果是不包括2^64和0这2个数的,你的计算结果中包含2^64和0吗?
还有,对于每一个素数,能否给出你的程序的运行时间?
liangbch
发表于 2013-10-24 14:27:28
下面我的程序的输出。
注:求2^64以内的p1-p4 smooth数的算法和其他smooth数是不同的,所以其计算时间略长。Total 64 p1-smooth-number in 2^64, It take 0.063 seconds
Total 1344 p2-smooth-number in 2^64, It take 0.031 seconds
Total 13282 p3-smooth-number in 2^64, It take 0.047 seconds
Total 85348 p4-smooth-number in 2^64, It take 0.047 seconds
Total 378554 p5-smooth-number in 2^64, It take 0.000 seconds
Total 1381206 p6-smooth-number in 2^64, It take 0.000 seconds
Total 4164316 p7-smooth-number in 2^64, It take 0.015 seconds
Total 11169655 p8-smooth-number in 2^64,It take 0.032 seconds
Total 26587554 p9-smooth-number in 2^64,It take 0.062 seconds
Total 56643654 p10-smooth-number in 2^64, It take 0.141 seconds
Total 113399428 p11-smooth-number in 2^64, It take 0.297 seconds
Total 210499995 p12-smooth-number in 2^64, It take 0.546 seconds
Total 370466869 p13-smooth-number in 2^64, It take 1.016 seconds
Total 627484292 p14-smooth-number in 2^64, It take 1.719 seconds
Total 1020181037 p15-smooth-number in 2^64, It take 2.859 seconds
Total 1591363196 p16-smooth-number in 2^64, It take 4.563 seconds
Total 2395982361 p17-smooth-number in 2^64, It take 7.031 seconds
Total 3527728592 p18-smooth-number in 2^64, It take 10.562 seconds
Total 5050259345 p19-smooth-number in 2^64, It take 15.485 seconds
Total 7077350886 p20-smooth-number in 2^64, It take 22.187 seconds
Total 9759368423 p21-smooth-number in 2^64, It take 31.500 seconds
Total 13183354386 p22-smooth-number in 2^64, It take 43.032 seconds
Total 17528499627 p23-smooth-number in 2^64, It take 59.484 seconds
Total 22918160232 p24-smooth-number in 2^64, It take 78.219 seconds
无心人
发表于 2013-10-27 17:37:10
liangbch 发表于 2013-10-23 17:10
这个题目的另一个说法是“求5-smooth数",百度知道(34#)给出的代码简单而有效,但有其局限性。用此代码求更 ...
这个似乎跟分解整数有关系
mathematica
发表于 2017-5-24 14:21:43
这个问题适合穷举法,先穷举出所有符合条件的数,从小到大,然后看第200项与2^200比较大小,
然后在程序中定义一个数组,把前200项赋值过去,
然后直接输出,
这是最快的办法,不需要任何运算!