Graipher's user avatar
Graipher's user avatar
Graipher's user avatar
Graipher
  • Member for 6 years, 9 months
  • Last seen more than a week ago
Stats
40,627
reputation
1.7m
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
63
silver badges
128
bronze badges
3,328
Score
779
Posts
99
Posts %
1,420
Score
313
Posts
40
Posts %
610
Score
131
Posts
17
Posts %
446
Score
107
Posts
14
Posts %
312
Score
77
Posts
10
Posts %
245
Score
44
Posts
6
Posts %
Top posts
View all questions and answers