Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

python solution for problem 25

  • Loading branch information...
commit 1631059e43720ddfce6cd655526366ce10618499 1 parent 72aa2cf
@jdp authored
Showing with 8 additions and 0 deletions.
  1. +8 −0 euler.py
View
8 euler.py
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.