Last active
September 21, 2017 22:03
-
-
Save matinkaboli/8882c4c63e5ae149b44d036cc4a18d1c 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
i = 3 | |
n = s = 1 | |
while (i <= 10001): | |
if (s == 1): | |
x = 6 * n -1 | |
s = 0 | |
else: | |
x = 6 * n +1 | |
s = 1 | |
n = n + 1 | |
r = x ** .5 | |
p = 1 | |
t = 3 | |
while (t <= r): | |
if (x % t == 0): | |
p = 0 | |
t = t + 2 | |
if (p == 1): | |
i = i + 1 | |
print(x) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment