No history yet

Introduction to Fibonacci Sequence

A Simple Pattern

Some number sequences are complex. The Fibonacci sequence is not. It's a list of numbers that follows a straightforward rule: add the last two numbers to get the next one.

Each number in the sequence is the sum of the two preceding numbers, creating a pattern that grows infinitely.

The sequence starts with 0 and 1. From there, the pattern takes over.

0 + 1 = 1 1 + 1 = 2 1 + 2 = 3 2 + 3 = 5

And so on. The first few terms look like this: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34...

Lesson image

The Formula

We can express this pattern as a mathematical rule. This kind of rule, which refers to previous terms, is called a recursive formula. Let's use the letter FF to stand for a Fibonacci number, and nn to represent its position in the sequence.

Term

noun

A single number or element in a sequence.

To find the nn-th term, written as FnF_n, you add the two terms that came before it: the (n1)(n-1)-th term and the (n2)(n-2)-th term. The formula looks like this:

Fn=Fn1+Fn2F_n = F_{n-1} + F_{n-2}

This rule works for any term as long as nn is 2 or greater. But a recursive formula needs a place to start. Without a starting point, it can't calculate anything. These starting points are called base cases.

The Base Cases

For the Fibonacci sequence, we need to define the first two terms so the formula has something to build on. These are the fixed points that get everything started.

F0=0F1=1F_0 = 0 \\ F_1 = 1

With these two base cases and the recursive formula, you can generate the entire, infinite Fibonacci sequence. Let's try it for F2F_2:

F2=F21+F22=F1+F0F_2 = F_{2-1} + F_{2-2} = F_1 + F_0

We already know F1=1F_1 = 1 and F0=0F_0 = 0, so:

F2=1+0=1F_2 = 1 + 0 = 1

It works. You can continue this process to find any Fibonacci number you want.

Now, let's test your understanding.

Quiz Questions 1/5

What is the next number in this sequence: 0, 1, 1, 2, 3, 5, 8, __?

Quiz Questions 2/5

The rule Fn=Fn1+Fn2F_n = F_{n-1} + F_{n-2} is an example of what kind of formula?