Graipher
  • Member for 5 years, 9 months
  • Last seen this week
Stats
40,276
reputation
1.5m
reached
771
answers
11
questions
Loading…
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

7
gold badges
62
silver badges
126
bronze badges
3,294
Score
777
Posts
99
Posts %
1,403
Score
312
Posts
40
Posts %
610
Score
131
Posts
17
Posts %
442
Score
107
Posts
14
Posts %
310
Score
77
Posts
10
Posts %
243
Score
43
Posts
5
Posts %