Created
October 20, 2020 18:33
-
-
Save mcvarer/69e3b058e13861377b64d4d5702f0068 to your computer and use it in GitHub Desktop.
projecteuler: 7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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? | |
""" | |
import sympy.ntheory as nt | |
def primeNumber10001(): | |
nd = 10001 | |
i, j = 0, 0 | |
while True: | |
if nt.isprime(i): | |
j += 1 | |
if nd == j: | |
print("10001. prime is = {}".format(i)) | |
break | |
i += 1 | |
primeNumber10001() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment