## Morris: Finding Fibonacci

If you are anything like me, and I hope for your sake that you aren’t, then you will often ask yourselves questions such as:

Late at night, when they’re peckish, do Vampires ever bite themselves?

Was Hitler’s moustache homage to Charlie Chaplin?

Can I find an exact formula for the Fibonacci sequence?

I can only answer one question. Which one?

Yup, it’s the last one.

In Yoak: Miles, Kilometers and Fibonacci Numbers Jeff showed a lot of fun stuff about the Fibonacci sequence and how it relates to the golden ratio. He didn’t explain how this comes about.

The Golden Ratio, phi (I’ll use g), was beloved by classical architects and is still loved today. It was thought to be the most aesthetically pleasing ratio. It was the ratio used for the Parthenon.

It has a simple definition, if you have a rectangle with proportions 1:g then you can remove a square from one end and the leftover is a rectangle with the same proportions.

From that you can work out that g^{2} = g + 1 and g = 1 + 1/g. There is a revealing symmetry in that last equation which is better shown by g – 1/g = 1, if you switch the sign and invert g then you get another solution.

Anyway:

g = (sqrt(5) + 1)/2 ~= 1.618

1/g= (sqrt(5) – 1)/2 ~= 0.618

The Fibonacci sequence goes 1, 1, 2, 3, 5, 8, 13, 21, 34 …

The Fibonacci rule is F_{n+2} = F_{n+1} + F_{n }

There are lots of sequences that fit this rule. Any particular sequence is fixed by specifying two elements, for example the actual Fibonacci sequence starts 1, 1. Another sequence that fits the rule is 1, 3, 4, 7, 11, 18, 29 …

We note that if x^{n+2} = x^{n+1} + x^{n} then the sequence 1, x, x^{2}, x^{3}, x^{4} … satisfies the Fibonacci rule.

We can solve for x. Dividing by x^{n} and rearranging gives x^{2} – x – 1 = 0.

This gives two solutions for x:

g = (1+sqrt(5))/2

(-1/g) = (1-g) = (1-sqrt(5))/2

Both of these solutions for x generate sequences that satisfy the Fibonacci rule.

1, g, g^{2}, g^{3} …

1, (1-g), (1-g)^{2}, (1-g)^{3} …

But we can go further. Put X_{n} = Ag^{n} + B(1-g)^{n }then X_{n} satisfies the Fibonacci rule.

A + B, Ag + B(1-g), Ag^{2} + B(1-g)^{2}, Ag^{3} + B(1-g)^{3} …

A particular sequence that satisfies the Fibonacci rule is fixed by just two entries. I claim that we can always find values for A and B that will create any sequence which satisfies the Fibonacci rule.

We have two simultaneous equations with two unknowns, A and B. This always gives a unique solution (it matters that (1, g) and (1, 1-g) are linearly independent vectors). For example lets calculate A and B for the actual Fibonacci sequence. F_{1} =1 and F_{2} = 1. Using the Fibonacci rule backwards gives F_{0} = 0.

So F_{0} = A + B = 0 F_{1} = Ag + B(1-g) = 1

Working this through

B = -A

Ag – A(1-g) = 1

A(2g -1) = 1

A(2(sqrt(5) + 1)/2 -1) = 1

A = 1/sqrt(5)

Which solves to give A = 1/sqrt(5), B = -1/sqrt(5)

So we have : F_{n} = (g^{n} – (1-g)^{n}) /sqrt(5)

Now there is something very bizarre going on here. We know that the Fibonacci sequence is a sequence of integers. We have found that it has an exact formula but the formula involves lots of irrational numbers, raising them to powers, adding and dividing them. Somehow this process always ends up with an integer. Knowing that we will always get an integer we can short-circuit the calculation.

Note that 1/ sqrt(5) is about 0.447, (1-g)/ sqrt(5) is about -0.276 and that (1-g)^{n}/ sqrt(5) always has a magnitude of less than a half. Knowing that we will always get an integer we can just ignore this term and round to the nearest integer.

F_{n} = round(g^{n} /sqrt(5)) for n >= 0

It is also true that

F_{-n} = (-1)^{n+1}round(g^{n} /sqrt(5)) for n >= 0

To see this remember that 1-g = -1/g so F_{n} = (g^{n} – (-1/g)^{n}) /sqrt(5). For negative n it is the first term that is smaller than a half and can be ignored. I’ll let you work out the rest.

In fact extending the Fibonacci sequence backwards gives … -3, 2, -1, 1, 0, 1, 1, 2, 3 …

What is most wonderful about this is that the ratio between successive members of the Fibonacci sequence is about g. It becomes very close very quickly. Also wonderful is that this technique extends to other sequences which are defined by similar rules. In general you can find an exact formula, involving taking powers of irrational numbers, which will always give you the integer you were looking for.

I find that quite amazing!

It shows that you cannot take one part of mathematics in isolation, if you want to understand integers you have to understand irrational numbers, and for many sequences complex numbers. It’s all interconnected, you can’t pick and choose. Even the simplest parts of mathematics are tied up in the most complex!

All good fun though!