The six prime numbers from the smallest are 2, 3, 5, 7, 11, 13, and the sixth prime number is 13.
Find the 100th prime number. http://odz.sakura.ne.jp/projecteuler/index.php?cmd=read&page=Problem%207
Use mymath that I made earlier to find it quickly. http://qiita.com/cof/items/45d3823c3d71e7e22920
import mymath
def cof():
max = 10**6
target = 10001
pri = mymath.get_primes(max)
print pri['list'][target-1]
if __name__ == '__main__':
cof()
I think about 125ms max was too big.
Recommended Posts