Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #We want the 10,001th prime
- n = 10001
- def Natural(x):
- while True:
- yield x
- x += 1
- primes = []
- isPrime = True
- i = 2
- while len(primes) < n:
- isPrime = True
- for j in range(2,int(i**(0.5)+1)):
- if i % j == 0:
- isPrime = False
- break
- if isPrime:
- primes.append(i)
- print(i)
- i += 1
- print(primes[n - 1])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement