Created
February 7, 2020 09:28
-
-
Save wil92/90043698b2c9492a963e351d5e79a770 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
n = 20 | |
criba = [] | |
for i in range(n): | |
criba.append(True) | |
def calculate_criba(): | |
criba[0] = criba[1] = False; | |
for i in range(2, n): | |
if criba[i] : | |
for j in range(i*i, n, i) : | |
criba[j] = False | |
calculate_criba() | |
print(criba) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment