Skip to content

Instantly share code, notes, and snippets.

View alanhaugen's full-sized avatar
💭
Wish I worked every day on my dreams

Hans Alan Whitburn Haugen alanhaugen

💭
Wish I worked every day on my dreams
View GitHub Profile
@alanhaugen
alanhaugen / primes
Last active December 10, 2017 22:25
#!/usr/bin/python3
# https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes
def sieve(sand):
for i in sand:
for j in sand:
if j != i and j%i == 0:
sand.remove(j)
return sand
# recursion