Exemplo n.º 1
0
Arquivo: p045.py Projeto: doboy/euler
from utils import triangleGen, pentagonGen, hexagonGen, argmin, equals

Z = T, P, H = triangleGen(), pentagonGen(), hexagonGen()
z = t, p, h = map( next, ( T, P, H ) )

while not equals( *z ) or z[0] in ( 1, 40755 ):
    m = argmin( *z )
    z[ m ] = next( Z[ m ] )

print z[ 0 ]

Exemplo n.º 2
0
Arquivo: p012.py Projeto: doboy/euler
from utils import divisors, triangleGen

for n in triangleGen():
    if len( divisors( n ) ) > 500:
        break

print n