コード例 #1
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)
コード例 #2
0
ファイル: problem007.py プロジェクト: ky90/Project-Euler
def solution():
    primes = next_prime()
    # Throw away the first 10000
    for x in xrange(10000):
        next(primes)
    # Here's the 10001st
    return next(primes)
コード例 #3
0
ファイル: problem010.py プロジェクト: ky90/Project-Euler
def yield_primes_under(x):
    primes = next_prime()
    p = next(primes)
    while p < x:
        yield p
        p = next(primes)
コード例 #4
0
def yield_primes_under(x):
    primes = next_prime()
    p = next(primes)
    while p < x:
        yield p
        p = next(primes)