We have discussed different methods to find nth Fibonacci Number.
Following is another mathematically correct way to find the same.
nth Fibonacci Number :
Here φ is golden ratio with value as
The above formula seems to be good for finding nth Fibonacci Number in O(Logn) time as integer power of a number can be calculated in O(Logn) time. But this solution doesn’t work practically because φ is stored as a floating point number and when we calculate powers of φ, important bits may be lost in the process and we may get incorrect answer.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
- Find nth Fibonacci number using Golden ratio
- Deriving the expression of Fibonacci Numbers in terms of golden ratio
- Finding number of digits in n'th Fibonacci number
- Check if a M-th fibonacci number divides N-th fibonacci number
- GFact 22 | (2^x + 1 and Prime)
- GFact 23 | (Brocard’s problem)
- GFact 48 | Overloading main() in Java
- Ratio of mth and nth terms of an A. P. with given ratio of sums
- Number of ways to represent a number as sum of k fibonacci numbers
- Finding power of prime number p in n!
- Finding the Parity of a number Efficiently
- Finding sum of digits of a number until sum becomes single digit
- Finding n-th number made of prime digits (2, 3, 5 and 7) only
- Nth Even Fibonacci Number
- Finding the number of triangles amongst horizontal and vertical line segments