Implementing Binet's Formula

Because ψn5\frac{\psi^n}{\sqrt{5}} won't ever affect the result enough to round to the wrong integer, this is an incredibly simple algorithm:

F(n)=round(ϕn5) F(n) = \text{round} \left( \frac{\phi^n}{\sqrt{5}} \right)

Let's put this formula into practice and see what happens!

Implementing Binet's Formula

Because ψn5\frac{\psi^n}{\sqrt{5}} won't ever affect the result enough to round to the wrong integer, this is an incredibly simple algorithm:

F(n)=round(ϕn5) F(n) = \text{round} \left( \frac{\phi^n}{\sqrt{5}} \right)

Let's put this formula into practice and see what happens!