Skip to content

Commit

Permalink
python solution for problem 25
Browse files Browse the repository at this point in the history
  • Loading branch information
jdp committed Apr 8, 2012
1 parent 72aa2cf commit 1631059
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions euler.py
Expand Up @@ -161,6 +161,14 @@ def euler_24():
return "".join(map(str, islice(permutations(range(10), 10), 999999, 1000000).next()))


def euler_25():
"""What is the first term in the Fibonacci sequence to contain 1000 digits?"""
from itertools import takewhile
from eutil import fib

return len(list(takewhile(lambda x: len(str(x)) < 1000, fib())))


def euler_29():
"""How many distinct terms are in the sequence generated by ab for 2 ≤ a ≤ 100 and 2 ≤ b ≤ 100?"""
m = 101
Expand Down

0 comments on commit 1631059

Please sign in to comment.