How are we able to calculate specific numbers in the Fibonacci Sequence?

A lot of people have mentioned Binet's formula. But I suspect this is not the most practical way to compute the nth Fibonacci number for large n, because it requires either having a very accurate value of $\sqrt{5}$ and carrying around lots of decimal places (if you want to do floating-point arithmetic) or expanding large powers of $1+\sqrt{5}$ using the binomial formula. The latter comes out to writing the Fibonacci number as a sum of binomial coefficients.

The following formulas hold, though: $$F(2n-1) = F(n)^2 + F(n-1)^2$$ $$F(2n) = (2F(n-1) + F(n)) \times F(n)$$ which you can find derivations of in the Wikipedia article on Fibonacci numbers. This lets you find $F(k)$, for any $k$ even or odd, in terms of two Fibonacci numbers with approximately half the index. The result is faster than Binet's formula.


Also you can use the matrix equation for Fibonacci numbers:

$$ \begin{pmatrix}1&1\\1&0\end{pmatrix}^n = \begin{pmatrix}F_{n+1}&F_{n}\\F_{n}&F_{n-1}\end{pmatrix} $$ To calculate $n$-th power of the matrix you can use exponentiation by squaring algorithm.

This approach could also be generalized on the case of arbitrary sequence with linear recurrence relation.


Wikipedia has a closed-form function called "Binet's formula".

http://en.wikipedia.org/wiki/Fibonacci_number#Relation_to_the_golden_ratio

$F\left(n\right) = {{\varphi^n-(1-\varphi)^n} \over {\sqrt 5}}$

This is based on the Golden Ratio.