Skip to content

Instantly share code, notes, and snippets.

@soimort
Created March 5, 2012 19:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save soimort/1980606 to your computer and use it in GitHub Desktop.
Save soimort/1980606 to your computer and use it in GitHub Desktop.
Project Euler - Problem 7
def prime(n):
if n == 1:
return 2
else:
i = prime(n - 1)
isPrime = False
while not isPrime:
i += 1
isPrime = True
for j in range(1, n):
if i % prime(j) == 0:
isPrime = False
break
return i
print(prime(10001))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment