I was wondering about how can one find the nth term of fibonacci sequence for a very large value of n say, 1000000. Using the grade-school recurrence equation fib(n)=fib(n-1)+fib(n-2)
, it takes 2-3 min to find the 50th term!
After googling, I came to know about Binet's formula but it is not appropriate for values of n>79 as it is said here
Is there an algorithm to do so just like we have for finding prime numbers?
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…