Processing math: 100%

Fibonacci convergence

We know from Fibonacci and the golden ratio that the n-th term of Fibonacci can be expressed as :

Fn=φn5=(1+52)n5

Searching for a number with at least 1000 digit is the same as searching a for number that is greater than or equal to 10999

φn5>=10999nlog(φ)log(5)2>=999log(10)n>=log(5)2+999log(φ)n=log(5)2+999log(φ)

Since n must be an integer, it is sufficient to take the ceiling from the previous equation.

From solution2.py:

def thousandth_digit_fibonacci_number(n=1000): return ceil((n - 1 + log10(sqrt(5)) / 2) / log10((1 + sqrt(5)) / 2))