Skip to content

Instantly share code, notes, and snippets.

@akrito
Created August 17, 2009 19:42
Show Gist options
  • Save akrito/169329 to your computer and use it in GitHub Desktop.
Save akrito/169329 to your computer and use it in GitHub Desktop.
from math import sqrt
primes = [2]
i = 1
while len(primes) < 10001:
i += 2
I = sqrt(i)
prime = True
for p in primes:
if p > I:
break
if i % p == 0:
prime = False
break
if prime:
primes.append(i)
print primes[-1]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment