Efficient Fibonacci (WIP)
This was a little side thing I've been working on.
I wanted to find a way to find a number (especially big ones) in the Fibonacci sequence without using recursion or memoization.
After researching it a bit I came across this equation online.
F(n) = ⌊Φⁿ/√5 + 1/2⌋, with Φ = (1+√5)/2
With this my program could find the right number from any position n without resorting to make multiple recursion and having to find the Fibonacci of every number below n, effectively (hopefully) making it faster and more efficient.
Comments
Post a Comment