This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
NUMBER = 100000000 | |
def get_prime_list(limit): | |
limit_sqrt = int(math.ceil(math.sqrt(limit))) | |
prime_bool_list = [False] * 2 + [True] * (limit - 2) | |
for prime_cand in xrange(2,limit_sqrt): | |
if prime_bool_list[prime_cand]: | |
for composite in range(prime_cand ** 2, limit, prime_cand): | |
prime_bool_list[composite] = False |