def solution():
    primes = next_prime()
    # Throw away the first 10000
    for x in xrange(10000):
        next(primes)
    # Here's the 10001st
    return next(primes)
Example #2
0
def solution():
    primes = next_prime()
    # Throw away the first 10000
    for x in xrange(10000):
        next(primes)
    # Here's the 10001st
    return next(primes)
Example #3
0
def yield_primes_under(x):
    primes = next_prime()
    p = next(primes)
    while p < x:
        yield p
        p = next(primes)
def yield_primes_under(x):
    primes = next_prime()
    p = next(primes)
    while p < x:
        yield p
        p = next(primes)