Created
May 21, 2014 22:53
-
-
Save goyuninfo/1d15141054126f66e4b7 to your computer and use it in GitHub Desktop.
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
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