Ejemplo n.º 1
0
Archivo: p7.py Proyecto: 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]
Ejemplo n.º 2
0
Archivo: p12.py Proyecto: 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
Ejemplo n.º 3
0
Archivo: p12.py Proyecto: 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
Ejemplo n.º 4
0
def run():
    print sum(eratosthenes(2000000))
Ejemplo n.º 5
0
Archivo: p10.py Proyecto: cadizm/euler
def run():
    print sum(eratosthenes(2000000))