Skip to content

Comment on On calculating Fibonacci numbers in Cparent

Comments

If you "drop" the 1/2, you can use Z(sqrt(5)) and work with only a pair of integers. Also, the two parts of the formula are "conjugates" so it's possible to get the exact result with only one half.

Define: Im5(a+b * sqrt(5)) =b

Fib(n)= Im5 ((1+1* sqrt(5))^n) / 2^(n-1)

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.