What Is the Fibonacci Sequence?
The Fibonacci sequence is an infinite series of whole numbers that starts with 0 and 1. Every number after that is found by adding the two numbers immediately before it: 0 + 1 = 1, 1 + 1 = 2, 1 + 2 = 3, 2 + 3 = 5, 3 + 5 = 8, and so on. It is also called the Fibonacci series, and each term is called a Fibonacci number. It is listed as sequence A000045 in the On-Line Encyclopedia of Integer Sequences.
The rule is simple, which is why the sequence is a common first example in maths and programming courses. It also has some genuinely interesting properties, including a close link to the golden ratio. If you need a long list of terms rather than the theory, the Fibonacci sequence generator produces them instantly.
The Fibonacci Sequence Formula
There are two standard ways to write the formula. The recursive formula builds the sequence term by term. Binet’s formula calculates any single term directly.
The recursive formula (Fn = Fn−1 + Fn−2)
Fn = Fn−1 + Fn−2, with F0 = 0 and F1 = 1
In words: the nth Fibonacci number equals the sum of the two Fibonacci numbers before it. The two starting values, called seed values, are required. Without them the rule has nothing to add up.
Binet’s formula: finding the nth term directly
Fn = (φn − ψn) / √5
Here φ (phi) = (1 + √5) / 2 ≈ 1.6180339887, the golden ratio, and ψ (psi) = (1 − √5) / 2 ≈ −0.6180339887. Although φ, ψ and √5 are all irrational, the irrational parts cancel exactly and the result is always a whole number.
Because ψn becomes tiny as n grows (less than 0.01 by n = 10), you can drop it and round instead. That gives the practical version:
Fn = round(φn / √5)
How to Calculate Fibonacci Numbers (Step by Step)
By hand
- Write down the seed values: 0 and 1.
- Add the last two numbers to get the next one: 0 + 1 = 1.
- Repeat with the newest pair: 1 + 1 = 2, then 1 + 2 = 3, then 2 + 3 = 5.
- Keep going until you reach the term you need, counting from F0 = 0.
This works well for the first 15 or 20 terms. Beyond that, the numbers grow quickly and arithmetic slips become likely.
Using Binet’s formula (worked: F10 = 55, F20 = 6,765)
F10: φ10 ≈ 122.9919. Divide by √5 (≈ 2.2361): 122.9919 ÷ 2.2361 ≈ 55.0036. Round to the nearest whole number: F10 = 55.
F20: φ20 ≈ 15,126.9999. Divide by √5: ≈ 6,765.00003. Round: F20 = 6,765.
A scientific calculator handles the powers of φ. For very large n, ordinary floating-point precision eventually breaks down, so programs usually compute large terms with whole-number arithmetic instead.
In code (iterative loop)
The recursive definition translates directly into a recursive function, but the naive version is slow: computing Fn recomputes the same smaller terms again and again, so the work grows exponentially. An iterative loop keeps only the last two values and finishes in n steps:
a, b = 0, 1
for i in range(n): a, b = b, a + b
# a is now F(n)
Memoisation (caching results already computed) fixes the recursive version too. Either approach is fine for practical use.
First 20 Fibonacci Numbers (Table, F0 to F20)
| n | Fn | n | Fn | n | Fn |
|---|---|---|---|---|---|
| 0 | 0 | 7 | 13 | 14 | 377 |
| 1 | 1 | 8 | 21 | 15 | 610 |
| 2 | 1 | 9 | 34 | 16 | 987 |
| 3 | 2 | 10 | 55 | 17 | 1,597 |
| 4 | 3 | 11 | 89 | 18 | 2,584 |
| 5 | 5 | 12 | 144 | 19 | 4,181 |
| 6 | 8 | 13 | 233 | 20 | 6,765 |
Need more than 20 terms? Generate any length of the sequence with the Fibonacci Generator.
Fibonacci Sequence Examples in Real Life

Plant growth (phyllotaxis). The spirals of seeds in a sunflower head, scales on a pinecone and leaves around a stem often come in Fibonacci numbers. This is a well-studied result of plants adding new growth at a consistent angle (close to 137.5°, the “golden angle”) from a central point, which packs growth efficiently. The pattern is common but not universal.
Computer science. Fibonacci numbers are a standard teaching example for recursion versus iteration. They also underpin Fibonacci search, a technique for searching sorted arrays, and the Fibonacci heap, a data structure used to improve the theoretical running time of graph algorithms such as Dijkstra’s shortest-path algorithm.
Financial charting. Some technical analysts draw “Fibonacci retracement” levels (23.6%, 38.2%, 61.8%) on price charts. These ratios come from the sequence, but there is no established mechanism that makes prices respect them. Treat them as a convention some traders watch, not a proven rule.
The Golden Ratio Connection — What’s Actually True
Divide any Fibonacci number by the one before it and the result gets closer and closer to φ ≈ 1.6180339887: 34 ÷ 21 ≈ 1.6190, 89 ÷ 55 ≈ 1.6182, 233 ÷ 144 ≈ 1.6181. This convergence is a proven result, and it is the reason Binet’s formula works.
What is overstated is the popular claim that the golden ratio appears with precision throughout nature, art and architecture. Some examples are close approximations; many are measured loosely after the fact. The sequence and the ratio are real mathematics, but “everything beautiful follows the golden ratio” is not a scientific finding.
Fibonacci vs Other Number Sequences
Fibonacci numbers are defined by adding earlier terms. That makes them different from:
- Arithmetic sequences, which add a fixed amount each time (2, 5, 8, 11…).
- Geometric sequences, which multiply by a fixed amount each time (3, 6, 12, 24…). Fibonacci numbers grow roughly geometrically, by a factor close to φ, but they are not exactly geometric.
- Prime numbers, which are defined by having no divisors other than 1 and themselves. A few numbers, such as 2, 3, 5 and 13, are both prime and Fibonacci. The prime number generator lists primes if you want to compare.
Sequences are also different from number systems. Writing a Fibonacci number in binary or hexadecimal does not change the sequence, only how it is written. The number system converter handles those conversions, and our guide to binary, decimal and hex explains how the bases work.
Several numbers in the Fibonacci sequence — 2, 3, 5, 13, 89 — are also prime numbers, which follow their own rule for what makes a number divisible only by itself and 1.
Frequently Asked Questions
What is the formula for the nth Fibonacci number?
There are two. The recursive formula is Fn = Fn−1 + Fn−2, with F0 = 0 and F1 = 1. To calculate a term directly, use Binet’s formula, Fn = (φn − ψn) / √5, or its rounded form Fn = round(φn / √5).
What is the 10th Fibonacci number?
It depends on where you start counting. With F0 = 0, the term F10 is 55. If you count 0 as the first term, the tenth number in the list is F9 = 34. Always check which convention a source uses.
Does the Fibonacci sequence start with 0 or 1?
Mathematically and in most programming contexts, it starts with F0 = 0 and F1 = 1. Some popular explanations skip the 0 and start 1, 1, 2, 3. Both describe the same sequence; only the starting index differs.
Can the Fibonacci sequence extend into negative numbers?
Yes. Running the rule backwards, Fn−2 = Fn − Fn−1, gives …, 5, −3, 2, −1, 1, 0, 1, 1, 2, 3, 5, …. These are sometimes called negafibonacci numbers.
Why is naive recursion slow for Fibonacci numbers?
A plain recursive function recalculates the same smaller terms many times, so the number of calls grows exponentially with n. An iterative loop or a memoised function calculates each term once, which takes only n steps.
The Bottom Line
The Fibonacci sequence follows one rule: each term is the sum of the two before it, starting from 0 and 1. Use the recursive formula to build the list step by step, Binet’s formula (or round(φn / √5)) to jump straight to a term such as F20 = 6,765, and the Fibonacci sequence generator when you need many terms at once. The link to the golden ratio is real; claims that it governs all of nature and art go further than the evidence.


