user avatar
user avatar
user avatar
Graipher
  • Member for 6 years, 3 months
  • Last seen this week
Stats
40,546
reputation
1.6m
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
127
bronze badges
3,321
Score
779
Posts
99
Posts %
1,419
Score
313
Posts
40
Posts %
609
Score
131
Posts
17
Posts %
445
Score
107
Posts
14
Posts %
310
Score
77
Posts
10
Posts %
245
Score
44
Posts
6
Posts %
Top posts
View all questions and answers