Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 
avatar of Graipher

Graipher

Graipher has asked 1 questions and find answers to 40 problems.

Stats

1.3k
EtPoint
452
Vote count
1
questions
40
answers

About

def prime_sieve(limit):
    prime = [True] * limit
    prime[0] = prime[1] = False

    for i, is_prime in enumerate(prime):
        if is_prime:
            yield i
            for n in range(i * i, limit, i):
                prime[n] = False

http://codereview.stackexchange.com/a/150447/98493