Skip to content

Instantly share code, notes, and snippets.

Jordan Kohn jordantkohn

Block or report user

Report or block jordantkohn

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View sieve_of_eratosthenes.py
def sieve(n):
'''
find all primes less than n
parameter: a natural number n
return: array of length n
the ith element is a binary flag that indicates if the natural number i is prime
(1 for prime, 0 for composite)
'''
x = [1] * n
x[1] = 0
You can’t perform that action at this time.