马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
从现在开始我们要开展一批欧拉计划的习题练习。
其实在我们论坛中已有欧拉计划的板块,可能有些鱼油还没注意到。
什么是欧拉计划:http://bbs.fishc.com/thread-60405-1-1.html
我们欧拉板块现已给出了200余题,这批练习将从欧拉计划中选题。其实用python语言完成有很多的优势,可以更简洁更方便的实现。
如果大家有兴趣也可浏览欧拉的英文网站:https://projecteuler.net/archives
这里已经有了500余题。
要求:
以python语言完成,如果是python2请注明。
程序以代码文字格式发帖。
注重程序效率和创意。
答题在一周内完成,即9.18 10:00之前,其后将公开大家的答案,并评比成绩。
另程序和答案可以在网上搜到,希望大家独立完成。题目不难,大家看看谁的效率高。
-- 回帖需写明解题思路,鼓励在程序中加上注释 --
-- 一些鱼油反映题目有些过难,为此略过一部分偏难的题目 --
293
题目:
如果正偶数N是2的幂,或者其所有不同的质因数恰好是连续质数,就被称为是可接受的。
前十二个可接受数是2、4、6、8、12、16、18、24、30、32、36、48。 如果N是可接受数,使得N+M为质数的最小整数M > 1就被称为N的伪幸运数。 例如,N=630是可接受数,因为它是偶数,而且它所有不同的质因数为连续质数2、3、5、7。
在631之后的下一个素数是641;因此,630的伪幸运数是M=11。
同样可以看出,16的伪幸运数是3。 找出所有小于109的可接受数N,分别求出其伪幸运数,并求所有不同的伪幸运数的和。
An even positive integer N will be called admissible, if it is a power of 2 or its distinct prime factors are consecutive primes.
The first twelve admissible numbers are 2,4,6,8,12,16,18,24,30,32,36,48. If N is admissible, the smallest integer M > 1 such that N+M is prime, will be called the pseudo-Fortunate number for N. For example, N=630 is admissible since it is even and its distinct prime factors are the consecutive primes 2,3,5 and 7.
The next prime number after 631 is 641; hence, the pseudo-Fortunate number for 630 is M=11.
It can also be seen that the pseudo-Fortunate number for 16 is 3. Find the sum of all distinct pseudo-Fortunate numbers for admissible numbers N less than 109.
|