Skip to content

Instantly share code, notes, and snippets.

@wil92
Created February 7, 2020 09:28
Show Gist options
  • Save wil92/90043698b2c9492a963e351d5e79a770 to your computer and use it in GitHub Desktop.
Save wil92/90043698b2c9492a963e351d5e79a770 to your computer and use it in GitHub Desktop.
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