I was reading up on the Fibonacci Sequence when I've noticed some were able to calculate specific numbers. So far I've only figured out creating an array and counting to the value, which is incredibly simple, but I reckon I can't find any formula for calculating a Fibonacci number based on it's position.

Is there a way to do this? If so, how are we able to apply these formulas to arrays?

Oh, I figured as so. I remember learning about this a while ago with the graph as presentation. Thanks.
–
JonnyLittJul 20 '10 at 19:27

It is much better than an approximation: it gives the exact value for all $n$
–
FanfanJul 20 '10 at 19:28

I see. That's the problem I notice in equations I was looking at before, the approximation kills the "closeness" to the number as the variable gets larger. I essentially see this as the solution, too bad I have to wait 7 minutes to accept yours as the answer. But, cheers, thanks.
–
JonnyLittJul 20 '10 at 19:32

By the way, if you want an approximation, you can neglect the second term, because $|1-\varphi|<1$, and get $F(n)={\varphi^n \over {\sqrt 5}}$ ; actually if you round that to the next integer you get the correct value.
–
FanfanJul 20 '10 at 19:41

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.

This is actually known to be (one of) the fastest ways to generate Fibonacci numbers (e.g. Mathematica uses this for integer arguments of the Fibonacci[] function).
–
Guess who it is.Aug 23 '10 at 16:26

The basic idea is to treat pairs of fibonnacci numbers, adjacent in the sequence, as vectors. Moving on to the next adjacent pair induces a linear transformation not unlike that of the matrix falagar posted. Calculating eigenvalues and eigenvectors can give a complete prediction of where an initial vector will find itself, predicting the whole sequence.

There's a perfectly general way for this sort of problem. I used it to look for instances of $p$, such that if $p$ divided a Fibonacci number, so did $p^2$. There are none under twenty million twelftywise $20.00.00.00.00_{120}=4147200000.$

This method can be used with modular arithmetic into the hundreds of millions.

These are a number of different series, the fibonacci, Lucas series, the side and diagonal of the square approximate, and Heron's triangle. It's written in the REXX programming language.

The actual process is to be found in the 'isoquad' routine, which extends an isoseries (ie a form $T_{n+1}= a.T_n - T_{n-1}$). The actual equation as written gives $T_p$, given in order $a, p, T_0 ,T_1$. It relies on that any isoseries, one can take steps of m, and thus take $T_{m+n} = a\text{^^}m \cdot T_n - T_{n-m}$.

The actual process is like this. The example is to find T(37) Numbers in brackets are the members of the original T(n). We halve out the T(n), and increase the step constant to $T(2x) = T(x)^2-2$, This is the difference between c0, c1, c2, c3.

The values in the second and third columns are as one divides 37 into binary.

The actual method is similar to finding $a^m$ by binary methods, and runs at 2/3 of the speed of said process.

By adjusting the nature of the multiplication to be a modulus, one can test to see if something like $f_{14400}$ is a multiple of 14401 or not. The heron series, with p set to large powers of 2, is used to find fermat primes, by this very method.