Exemplo n.º 1
0
Arquivo: mix.py Projeto: tomik/euler
def problem_25():
    """
    F1 = 1 
    F2 = 1
    F3 = 2 
    ...
    What is the first term in the Fibonacci sequence to contain 1000 digits?
    """
    i = 0
    for f in elib.fib():
        i += 1
        if (len(str(f)) >= 1000):
            return i
Exemplo n.º 2
0
Arquivo: mix.py Projeto: tomik/euler
def problem_2():

    return sum(elib.conditioned_generator(elib.filtered_generator(elib.fib(), lambda x: x % 2 == 0), lambda x: x < 4000000))