Pages

Tuesday, June 7, 2011

Number of digits in Fibonacci term (Project Euler problem 25)

Q: The question from the problem 25  is to find the first term in the Fibonacci sequence to contain 1000 digits. 


A: The answer comes from wiki


Since Fn is asymptotic to \varphi^n/\sqrt5, the number of digits in F_n\, is asymptotic to n\,\log_{10}\varphi\approx0.2090\,n. As a consequence, for every integer d > 1 there are either 4 or 5 Fibonacci numbers with d decimal digits.


So, 1000/0.2090 is approximately  4784, and the first Fibonacci term with 1000 digits is the 4782th term.

No comments:

Post a Comment