第七题求第10001个质数(用这个代码,我的笔记本大概算了40s):count=1num=3def findPrime(s): i=2 a=s while i<s/2: if s%i == 0: s=s/i break ...
分类:
其他好文 时间:
2014-09-13 22:45:16
阅读次数:
229
10001st prime
Problem 7
By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13.
What is the 10 001st prime number?
使用埃拉托斯特尼筛法,不懂得自行Wiki
我的py...
分类:
其他好文 时间:
2014-05-26 05:35:25
阅读次数:
248
Summation of primes
Problem 10
The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17.
Find the sum of all the primes below two million.
还是使用Sieve of Eratosthenes 算法
我的python代码如下:
...
分类:
其他好文 时间:
2014-05-26 03:40:15
阅读次数:
243
Sum square difference
Problem 6
The sum of the squares of the first ten natural numbers is,
12 + 22 + ... + 102 = 385
The square of the sum of the first ten natural numbers is,
(1 + 2 + ....
分类:
其他好文 时间:
2014-05-23 02:22:57
阅读次数:
193
Smallest multiple
Problem 5
2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.
What is the smallest positive number that is evenly di...
分类:
其他好文 时间:
2014-05-23 01:51:13
阅读次数:
261
Problem 4: Largest palindrome product
A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99.
Find the largest pal...
分类:
其他好文 时间:
2014-05-22 18:48:46
阅读次数:
355