Skip to main content
Graipher's user avatar
Graipher's user avatar
Graipher's user avatar
Graipher
  • Member for 8 years, 5 months
  • Last seen more than a week ago
Stats
40,986
reputation
1.9m
reached
773
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
69
silver badges
133
bronze badges
3,359
Score
779
Posts
99
Posts %
1,427
Score
313
Posts
40
Posts %
609
Score
131
Posts
17
Posts %
452
Score
106
Posts
14
Posts %
319
Score
77
Posts
10
Posts %
248
Score
44
Posts
6
Posts %