示例#1
0
文件: p7.py 项目: cadizm/euler
def run():
    key = 10001
    i = 1
    P = eratosthenes(key * i)
    while len(P) < key:
        i *= 2
        P = eratosthenes(key * i)
    print P[key - 1]
示例#2
0
文件: p12.py 项目: cadizm/euler
def run():
    P = eratosthenes(6500)  # 6500 by trial/error
    t = TriangleNumberGenerator()
    while True:
        n = t.next()
        if ndivisors(n, P) > 500:
            print n
            break
示例#3
0
文件: p12.py 项目: cadizm/euler
def run():
    P = eratosthenes(6500)  # 6500 by trial/error
    t = TriangleNumberGenerator()
    while True:
        n = t.next()
        if ndivisors(n, P) > 500:
            print n
            break
示例#4
0
def run():
    print sum(eratosthenes(2000000))
示例#5
0
文件: p10.py 项目: cadizm/euler
def run():
    print sum(eratosthenes(2000000))