Skip to main content
Graipher's user avatar
Graipher's user avatar
Graipher's user avatar
Graipher
  • Member for 8 years, 10 months
  • Last seen this week
Stats
41,086
reputation
2.0m
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,364
Score
779
Posts
99
Posts %
1,430
Score
313
Posts
40
Posts %
609
Score
131
Posts
17
Posts %
453
Score
106
Posts
14
Posts %
319
Score
77
Posts
10
Posts %
248
Score
44
Posts
6
Posts %
Top posts
View all questions and answers