Skip to content

Commit

Permalink
Add 007
Browse files Browse the repository at this point in the history
  • Loading branch information
eberjoe committed Jan 6, 2019
1 parent 3ed8b61 commit f909999
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions problem007.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Find the nth prime

import math

n = 10001
k = 0
i = 1

def isPrime(x):
a = int(math.sqrt(x))
for i in range(2, a+1):
if x%i == 0:
return False
return True

while k < n:
i += 1
k += isPrime(i)

print(i)

0 comments on commit f909999

Please sign in to comment.