标签:
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?
python code :
import math
sqrt=math.sqrt
def func(x):
k=int(sqrt(x))+1
for i in range(2,k):
if x%i==0:
return 0
return 1
k=3
temp=6
while 1:
temp+=1
if func(temp)==0:
continue
else:
k+=1
if k==10001:
break
print(temp)
result : 104743
timt : 1s
标签:
原文地址:http://blog.csdn.net/zhangzhengyi03539/article/details/43163713