Skip to content

Instantly share code, notes, and snippets.

@goyuninfo
Created May 21, 2014 22:53
Show Gist options
  • Save goyuninfo/1d15141054126f66e4b7 to your computer and use it in GitHub Desktop.
Save goyuninfo/1d15141054126f66e4b7 to your computer and use it in GitHub Desktop.
import math
def isPrime(n):
i=2
while i<=math.sqrt(n):
if n%i==0:
return 0
i=i+1
return 1
i=3
j=0
c=2
while 1:
j=j+1
i=6*j-1
if isPrime(i):
c=c+1
if c==10001:
break
i=6*j+1
if isPrime(i):
c=c+1
if c==10001:
break
print i
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment