The Fibonacci sequence starts with 0 and 1, and every following term is the sum of the two before it: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144… It is entry A000045 of the On-Line Encyclopedia of Integer Sequences and one of the most studied sequences in mathematics, appearing in the analysis of algorithms, in combinatorics (the number of ways to tile a strip with squares and dominoes) and in the spiral patterns of sunflowers and pine cones.
This Fibonacci calculator has three modes. nth term returns exactly for any index up to 10,000 using big-integer arithmetic — no rounding, no floating-point overflow — together with its number of digits, its scientific notation, Binet’s approximation and the ratio , which approaches the golden ratio. Values up to are printed in full; beyond that, the calculator shows the first and last twenty digits (the full has 2,090 digits). Sequence lists every term between two indices, with a table and their sum. Is it Fibonacci? tests any whole number, even one with thousands of digits, and tells you its position or the two Fibonacci numbers it falls between.
You can also change the starting terms and : with 2 and 1 you get the Lucas numbers, and any other pair gives a generalised Fibonacci sequence that follows the same rule.
How to use this calculator
- Pick a mode: nth term, Sequence or Is it Fibonacci?.
- For the nth term, enter the index (0 to 10,000). For a sequence, enter the first and last index (up to 201 terms).
- Leave the starting terms at 0 and 1 for the classic sequence, or change them for Lucas numbers or your own sequence.
- To test a number, type it in the test field; the answer comes with the perfect-square check that proves it.
- Open the steps to see the recurrence, the first terms and Binet’s formula.
The formula
The sequence is defined by the recurrence
Binet’s formula gives a closed form with the golden ratio and :
Because , the second term vanishes quickly, so is the integer nearest to and .
For exact values the calculator uses the doubling identities and . With custom starting terms , the n-th term is .
Fibonacci test: a natural number is a Fibonacci number if and only if or is a perfect square.
Worked example
nth term. = 55, = 144, = 6,765 and = 12,586,269,025. The 100th Fibonacci number has 21 digits: 354224848179261915075. has 209 digits and starts with 4346655768.
Golden ratio. , already within one millionth of .
Lucas numbers. With and the calculator gives 2, 1, 3, 4, 7, 11, 18, 29, 47, 76 and = 123.
Sum. Listing to gives a total of 143, which is .
Test. Is 144 a Fibonacci number? = 103,684 = 322², a perfect square, so yes: . For 100, neither 50,004 nor 49,996 is a square, so 100 is not a Fibonacci number; it lies between and .
Fibonacci numbers and the golden ratio
The ratios of consecutive terms — 2/1, 3/2, 5/3, 8/5, 13/8… — alternate above and below the golden ratio and converge to it: 1.5, 1.667, 1.6, 1.625, 1.615… This is a direct consequence of Binet’s formula. It also explains why grows roughly by a factor of 1.618 at each step, so the number of digits rises by about per index: has close to digits. See the golden ratio calculator to split a length by .
A few useful facts: every third Fibonacci number is even, every fifth is a multiple of 5, and . Extended to negative indices, , sometimes called the negafibonacci numbers.
Frequently asked questions
Does the Fibonacci sequence start with 0 or 1?
Modern references, including OEIS A000045 and Knuth, start with F₀ = 0 and F₁ = 1. Some older books start with 1, 1, which only shifts the index by one. This calculator uses F₀ = 0, so F₁₂ = 144.
How can I tell if a number is a Fibonacci number?
Compute 5x² + 4 and 5x² − 4. The number x is a Fibonacci number exactly when one of them is a perfect square. For 21: 5 × 441 + 4 = 2209 = 47², a perfect square, so 21 is a Fibonacci number (F₈).
Why does Binet’s formula give whole numbers?
The irrational parts of φⁿ and ψⁿ cancel exactly when you subtract them and divide by √5. In practice φⁿ/√5 rounded to the nearest integer is enough, but floating-point rounding breaks down beyond about F₇₀, which is why the exact value is computed with integers.
What are Lucas numbers?
They follow the same rule as Fibonacci numbers but start with 2 and 1: 2, 1, 3, 4, 7, 11, 18, 29… Set the starting terms to 2 and 1 to compute them. Lₙ = Fₙ₋₁ + Fₙ₊₁.
How large can n be?
Up to 10,000. F₁₀₀₀₀ has 2,090 digits; the calculator computes all of them exactly, counts them and shows the first and last twenty. Values up to F₁₀₀₀ are displayed in full.
Sources
- OEIS A000045 — Fibonacci numbers
- Knuth, D. E., The Art of Computer Programming, vol. 1: Fundamental Algorithms, 3rd ed. — §1.2.8 Fibonacci numbers
- Weisstein, E. W., Fibonacci Number — Wolfram MathWorld
- Gessel, I., Fibonacci is a Square (problem H-187), The Fibonacci Quarterly 10(4), 1972, pp. 417–419
Last updated: