Fibonacci Sequence Calculator
Generate the first N Fibonacci numbers or jump straight to F(n) for any zero-indexed position up to 1000. Uses BigInt for exact values beyond F(78) and shows the golden ratio approximation.
Fibonacci Sequence Reference
| Index n | F(n) | F(n+1)/F(n) |
|---|---|---|
| 5 | 5 | 1.6 |
| 10 | 55 | 1.6182 |
| 15 | 610 | 1.6180 |
| 20 | 6,765 | 1.6180 |
| 30 | 832,040 | 1.6180 |
| 50 | 12,586,269,025 | 1.6180 |
Frequently Asked Questions about the Fibonacci Sequence Calculator
What is the Fibonacci sequence?
The Fibonacci sequence is the list of integers defined by F(0) = 0, F(1) = 1, and F(n) = F(n - 1) + F(n - 2) for n at least 2. Every term after the first two is the sum of the two terms before it: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, and so on. The sequence shows up across mathematics, biology, and finance because the recurrence is the simplest non-trivial linear pattern that grows in both directions.
How is the Fibonacci sequence connected to the golden ratio?
As n grows, the ratio of consecutive Fibonacci numbers F(n) / F(n - 1) approaches the golden ratio phi = (1 + sqrt(5)) / 2, about 1.6180339887. By F(20) the ratio matches phi to seven decimal places, and by F(50) it matches to fifteen. This calculator returns that running approximation so you can watch convergence in real time. The link is no coincidence: phi is the dominant root of the characteristic equation x^2 = x + 1 that the Fibonacci recurrence satisfies.
What is Binet's formula and when does it stop being accurate?
Binet's closed-form expression is F(n) = (phi^n - psi^n) / sqrt(5), where phi = (1 + sqrt(5)) / 2 and psi = (1 - sqrt(5)) / 2. It returns the exact integer F(n) in theory, but on a computer phi^n is stored as a 64-bit float, and rounding error accumulates as n grows. Around F(71) the rounded result starts to drift by one from the true value, so this calculator only uses Binet up to n = 70 and switches to iterative BigInt arithmetic above that.
Where does the Fibonacci sequence appear in nature?
Fibonacci-related counts often appear in plant phyllotaxis, including some spiral counts in sunflower heads, pinecones, and pineapples. The golden angle can help model efficient packing, but biological specimens vary and not every spiral count is Fibonacci. A nautilus shell is approximately logarithmic, but it is not generally a golden-ratio spiral.
Why does this calculator use BigInt past F(78)?
F(79) is the first Fibonacci number larger than Number.MAX_SAFE_INTEGER (2^53 - 1, about 9 x 10^15). F(78) is 8,944,394,323,791,464, which still fits exactly in a 64-bit double; F(79) is 14,472,334,024,676,221, which does not. Above that limit, a standard JavaScript number cannot represent every integer exactly, so additions silently round and the displayed value becomes wrong. BigInt stores integers of arbitrary size and never rounds, so this calculator computes every term with BigInt internally and only converts back to a number for display when the value still fits safely. Beyond that threshold you see the exact digits as a string.
Related Calculators
More calculators in "Math"
ANOVA Calculator (One-Way)Correlation Coefficient CalculatorMAPE Calculator (Mean Absolute Percentage Error)Percentile Rank CalculatorMoving Average Calculator (SMA, EMA, WMA)Modular Inverse Calculator
See all 202 calculators in "Math"