Created
February 8, 2018 07:12
-
-
Save magical/5055e26490c091fbdbff0f25b1c11233 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/usr/bin/env python3 | |
N = 99999 | |
a = [1,1] + [0]*N | |
i = 1 | |
j = 0 | |
while i < N: | |
if i == j: | |
print(i) | |
if j > N: | |
j = 0 | |
elif j >= i: | |
a[j] = 1 | |
j += i | |
elif a[i]: | |
i += 1 | |
else: | |
j = i |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment