Fibonacci Calculator
Result
Terms (F(1) to F(n))
- Nth term
- 55
- Golden ratio estimate
- 1.61764706
The Fibonacci sequence starts with two 1s, and every term after that is the sum of the two before it: 1, 1, 2, 3, 5, 8, 13, 21, 34, 55 and onward. This page produces the first n terms, the value of the nth term on its own, and the ratio of the last term to the one before it. That last output is the reason the page is worth more than a lookup table. The ratios start wobbling — 2, then 1.5, then 1.6667, then 1.6 — and they settle down fast on a single number, 1.6180339887..., which is the golden ratio. By the twentieth term the ratio is already right to within a millionth. Nothing in the definition mentions that number; it falls out of the addition, and watching it fall out is the interesting part. This page counts from 1, so F(1) is 1, F(2) is 1, F(3) is 2 and F(10) is 55. There is a second convention in general use that starts at F(0) = 0, and under it F(5) is 5 where this page gives 8. Both are correct, but a page has to pick one, and mixing them is the single most common way to get a Fibonacci answer wrong. The ceiling of 78 terms is not a limit of the idea but of the arithmetic: the terms pass what a double-precision number can hold exactly at F(79), so the page stops one term short of the point where the answers would start being approximations. The sequence itself is worth a word about because it is the rare example that arrives from two directions. One is a puzzle about breeding rabbits: start with a pair, let each pair take a month to mature and then produce a new pair every month, and the counts per month are exactly these numbers. The other is the definition above — add the last two — and it is not obvious that these are the same thing, which is why the sequence turns up in places that have nothing to do with each other. Sunflower seed spirals, pine cone scales and the arrangement of leaves around a stem all run on these numbers, and the reason is always the golden ratio the ratios converge to. What the sequence is not is a law of nature or a design principle: it is a recurrence that happens to approximate the most irrational number there is, and nature's uses of it are the ones where that approximation pays.
The first ten terms, with the ratio of each term to the one before it
| n | Term | Ratio to the previous term |
|---|---|---|
| 1 | 1 | — |
| 2 | 1 | 1.00000000 |
| 3 | 2 | 2.00000000 |
| 4 | 3 | 1.50000000 |
| 5 | 5 | 1.66666667 |
| 6 | 8 | 1.60000000 |
| 7 | 13 | 1.62500000 |
| 8 | 21 | 1.61538462 |
| 9 | 34 | 1.61904762 |
| 10 | 55 | 1.61764706 |
Read the right-hand column top to bottom and you are watching a number make up its mind. It starts at 2 — the second term is 1 and the first is 1, but 2 ÷ 1 is 2 — then drops to 1.5, jumps back up to 2, falls to 1.667, and then swings shrink fast: 1.6, 1.625, 1.615, 1.619, 1.617647. The oscillation is the point. The ratio does not approach 1.618 from one side; it overshoots and undershoots alternately, with each swing roughly a factor of two smaller than the last, which is why the printed value is already correct to two decimal places by the tenth row. The true golden ratio begins 1.6180339887, so by row ten the remaining error is in the third decimal. The first row has a dash instead of a ratio because there is no previous term to divide by — the same reason the page refuses a one-term request rather than printing a blank.
Formula
F(1) = 1, F(2) = 1, F(n) = F(n − 1) + F(n − 2) ⇒ 1, 1, 2, 3, 5, 8, 13, 21, 34, 55 …;相邻两项之比 → φ = (1 + √5) / 2 = 1.6180339887…
- F(1) = F(2) = 1
- The two starting values, and the choice the page makes explicit. Counting from 1 means F(1) and F(2) are both 1 and F(10) is 55. The other common convention sets F(0) = 0 and F(1) = 1, which shifts every index by one so that F(5) is 5 rather than 8. Neither is wrong, but they disagree about every single index
- F(n) = F(n − 1) + F(n − 2)
- The recurrence, which is the whole definition. Each term is the sum of the two before it: 1 + 1 = 2, 1 + 2 = 3, 2 + 3 = 5, 3 + 5 = 8. Working forward from two starting values is why the page can produce a thousand terms as easily as ten — there is no formula to solve, just an addition repeated
- n
- How many terms you want, from 2 to 78. The lower bound is 2 rather than 1 because the ratio output needs a term and the one before it, so a single term would have nothing to divide by; the page refuses it rather than printing a blank ratio. The upper bound is the point where the terms stop being exact in ordinary floating-point arithmetic
- F(78) = 8944394323791464
- The last term this page will reach, and the reason it stops there. F(79) is 14472334024676221, which is past the largest whole number a double can hold exactly — 9007199254740991 — so from that point on the printed digits would be an approximation rather than the sequence. The page refuses 79 rather than printing a term that is nearly right
- F(n) / F(n − 1)
- The ratio output. It is not the golden ratio and the page does not claim it is: 1.6667 is what you get at the fifth term and it is a long way from 1.618. What it is is an estimate that improves fast — the twentieth term is already right to eight decimal places, which is the precision the page prints
- φ = 1.6180339887…
- The golden ratio, the number these ratios converge on. It is the positive solution of x² = x + 1, which is the same recurrence written as an equation — that is not a coincidence, it is why the Fibonacci ratios land on it. Note that the printed estimate is at most 1.61803399: the page shows eight decimals, and the true value continues past them
Checking a term is the plain use: a puzzle asks for the tenth Fibonacci number or a sequence in a textbook goes further than you want to add by hand, and the page gives the value and the run of terms leading to it. The ratio output serves a different question, which is where the golden ratio comes from. Seeing 2, 1.5, 1.6667, 1.6, 1.625, 1.615 settle toward 1.618 is a much shorter route to understanding the connection than reading a proof, and the reference table on this page is laid out for exactly that reading. A third use is in programming and coursework, where the recurrence is the standard first example of recursion, and the sequence is the standard example of a recursive definition that is far cheaper to compute iteratively — this page's loop is the iterative version, which is why 78 terms cost nothing. The numbers also appear in estimating problems where growth compounds on itself: the number of ways to tile a strip with squares and dominoes, the number of paths up a staircase taking one or two steps at a time, and the branching counts of a plant that splits each season all follow the same recurrence. When the question is about the ratio rather than the sequence, golden-ratio-calculator treats it as a number in its own right with its own properties; when it is about the growth pattern, exponential-growth-calculator covers the smooth version of what these terms approximate in steps.
Worked examples
The first ten terms: 1, 1, 2, 3, 5, 8, 13, 21, 34, 55
- Start with 1 and 1, the two starting values this page uses
- 1 + 1 = 2, then 1 + 2 = 3, then 2 + 3 = 5, then 3 + 5 = 8
- Continue: 5 + 8 = 13, 8 + 13 = 21, 13 + 21 = 34, 21 + 34 = 55
- Ten terms, so the tenth is 55; the ratio of the last two is 55 ÷ 34 = 1.61764706
The default input. Note that the tenth term is 55 and the ratio of 55 to 34 is 1.61764706 — close to the golden ratio but still visibly off it in the third decimal place. That is what makes the sequence worth watching rather than just looking up: the convergence is fast but it is not instant, and ten terms is not yet enough for the printed eight decimals to reach 1.61803399.
The shortest run: two terms
- Two terms is the smallest request this page accepts
- The sequence is just the two starting values: 1 and 1
- The second term is 1, so the nth term output is 1
- The ratio is 1 ÷ 1 = 1 — as far from the golden ratio as this page ever gets
The lower bound, and the reason it is 2 rather than 1. The ratio output needs two terms to exist at all; with a single term there would be nothing to divide by, so the page refuses 1 instead of printing a blank or a zero. The ratio of 1 is also the starting point of the whole convergence: every later ratio is a step away from it, and the run from 1 to 1.618 is what the table below lays out term by term.
Where the ratio settles: twenty terms
- Continue the recurrence from the tenth term: 34 + 55 = 89, 55 + 89 = 144, and so on
- The twentieth term is 6765, and the nineteenth is 4181
- 6765 ÷ 4181 = 1.61803396317…
- Rounded to the eight decimals the page prints, that is 1.61803396
Twenty terms is enough. The true golden ratio begins 1.6180339887, and the estimate here agrees with it to seven decimal places — the divergence is now in the eighth, which is the last one printed. Compare this with the ten-term case, where the error was already visible in the third decimal. This is the point the page exists to make: the recurrence has nothing to do with the golden ratio in its definition, and yet it produces it, quickly and from nothing but addition.
Limitations
The number of terms must be a whole number from 2 to 78. One is refused because the ratio output needs two terms to exist, and 79 is refused because the terms stop being exact there: F(78) is 8944394323791464, the last Fibonacci number that fits exactly in a double-precision value, and F(79) is past the ceiling of 9007199254740991. The page declines the request rather than returning an approximate term, since a number that is nearly right but printed to sixteen digits looks exactly like a correct one. The count is 1-based and this page uses F(1) = F(2) = 1. The other widespread convention sets F(0) = 0 and F(1) = 1, which shifts every index by one — under that convention the fifth term is 5, and here it is 8. Both conventions are in use in textbooks and in software, so if you are comparing this page against another source and the numbers are off by one position, that is the reason rather than an error. The ratio output is an estimate and is printed to eight decimals; it is never exactly the golden ratio for any finite number of terms, though by the seventy-eighth the printed value and the golden ratio are the same eight digits. The terms themselves are printed as a comma-separated list with no grouping separators, so the tenth term reads 55 and the seventy-eighth reads 8944394323791464 — reading long terms aloud is a job for the nth term output rather than for the list. Finally, the reference table is fixed at the first ten terms and does not follow your input; it is there to show the ratio settling rather than to answer what you typed.
Frequently asked questions
- Does the sequence start at F(0) or F(1)?
- This page starts at F(1), so F(1) = 1, F(2) = 1, F(3) = 2, and the tenth term is 55. The other convention in wide use sets F(0) = 0 and F(1) = 1, which shifts every index by one — under it the fifth term is 5, while here it is 8. Both are used in textbooks and in software, and neither is an error. But if you compare this page against another source and the values line up one position off, this is why; it is the single most common way a Fibonacci answer goes wrong.
- Why does the ratio keep changing instead of settling immediately?
- Because it is a limit rather than an identity. Each term is the sum of the two before it, so the ratio of consecutive terms moves by a fixed rule of its own, and the movement alternates above and below the target with each swing about half the size of the last. The table on this page shows it: 2, 1.5, 2, 1.667, 1.6, 1.625, then narrowing to 1.615 and 1.619. Ten terms is close, twenty is enough for the eight decimals the page prints, and no finite number of terms is exactly the golden ratio — only closer to it.
- What is the golden ratio, and why does this sequence produce it?
- The golden ratio is 1.6180339887…, the positive solution of x² = x + 1. That equation is the Fibonacci recurrence written differently — if the ratios settle on some number, that number has to satisfy it — which is why the sequence lands there and why the convergence is not a coincidence or a curiosity. The ratio is also the hardest number to approximate with fractions, because its continued fraction is all 1s, and that is the property plants exploit when they space leaves and seeds by it.
- Why can I only ask for 78 terms?
- Because F(79) is larger than the biggest whole number a double-precision value can hold exactly, which is 9007199254740991. F(78) is 8944394323791464 and is exact; F(79) is 14472334024676221 and would be stored as something close to it but not equal to it. The page refuses the request instead of printing an approximation, because a term printed to sixteen digits looks exactly like a correct one — there is no way to see the error from the output. The term count is a floating-point fact, not a mathematical one; the sequence itself goes on forever.
- Where does the rabbit problem come in?
- Fibonacci introduced the sequence with a puzzle: start with one pair of rabbits, let each pair take a month to mature and then produce a new pair every month, and count the pairs at the start of each month. The counts come out 1, 1, 2, 3, 5, 8 and so on, because last month's mature pairs all still exist and this month's new pairs come from the ones that were mature a month ago — which is the recurrence, arrived at from a completely different direction. It is worth knowing because it shows the sequence is not defined by any single application.
- Can I compute the nth term without listing all the earlier ones?
- In principle yes, and the page's nth term output gives you that number on its own line, but it is produced by the same loop rather than by a shortcut formula. The reason is exactness: there is a closed form, Binet's formula, that gives the nth Fibonacci number directly from the golden ratio, but it involves irrational numbers raised to a power, and in floating-point arithmetic it drifts away from the true integer for larger n. Adding integers is exact where that formula is not, so the page adds. Working forward from two starting values is also why 78 terms cost nothing — there is no formula to solve, just an addition repeated 76 times.
References
- Fibonacci Number — the recurrence, the closed form in terms of the golden ratio, and the identity that makes the ratio converge on it — Wolfram MathWorld (United States)
- Golden Ratio — the number 1.6180339887…, its definition as the positive root of x² = x + 1, and why it is the hardest number to approximate with fractions — Wolfram MathWorld (United States)
- Continued Fraction — why the all-ones continued fraction of the golden ratio is exactly what makes the Fibonacci ratios converge on it — Wolfram MathWorld (United States)
- 教育部关于印发义务教育课程方案和课程标准(2022 年版)的通知——The fifth item in the annex list of this notice is the Mathematics Curriculum Standards for Compulsory Education (2022 edition); exploring patterns of change in simple settings is part of the Number and Algebra strand at the primary school level, and the wording of the standards and the grade-band breakdown are governed by that annex — 中华人民共和国教育部