Fibonacci convergence
We know from Fibonacci and the golden ratio that the n-th term of Fibonacci can be expressed as :
Fn=φn√5=(1+√52)n√5
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
φn√5>=10999n∗log(φ)−log(5)2>=999∗log(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))