Skip to content

Fibonacci Calculator: nth Term, Sequence and Fibonacci Test

Exact nth Fibonacci number up to n = 10,000, sequence listings, custom starting terms and a Fibonacci-number test.

Your details

Calculate

0 and 1 give the Fibonacci numbers; 2 and 1 give the Lucas numbers.

Results update as you type

Fₙ

55

Number of digits
2
Binet approximation φⁿ/√5
≈ 55.003636
Ratio Fₙ / Fₙ₋₁
1.6176470588

Step-by-step solution
  1. Recurrence: each term is the sum of the two before it.
  2. First terms: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, …
  3. Binet: F₁₀ = round(φ¹⁰ / √5), φ = (1 + √5) / 2 ≈ 1.6180339887

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 FnF_n 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 Fn/Fn−1F_n/F_{n-1}, which approaches the golden ratio. Values up to F1000F_{1000} are printed in full; beyond that, the calculator shows the first and last twenty digits (the full F10000F_{10000} 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 F0F_0 and F1F_1: 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

  1. Pick a mode: nth term, Sequence or Is it Fibonacci?.
  2. For the nth term, enter the index nn (0 to 10,000). For a sequence, enter the first and last index (up to 201 terms).
  3. Leave the starting terms at 0 and 1 for the classic sequence, or change them for Lucas numbers or your own sequence.
  4. To test a number, type it in the test field; the answer comes with the perfect-square check that proves it.
  5. Open the steps to see the recurrence, the first terms and Binet’s formula.

The formula

The sequence is defined by the recurrence

F0=0,F1=1,Fn=Fn−1+Fn−2(n≥2)F_0 = 0, \quad F_1 = 1, \quad F_n = F_{n-1} + F_{n-2} \quad (n \ge 2)

Binet’s formula gives a closed form with the golden ratio φ=1+52\varphi = \frac{1 + \sqrt5}{2} and ψ=1−52\psi = \frac{1 - \sqrt5}{2}:

Fn=φn−ψn5,Fn=round⁡ ⁣(φn5)F_n = \frac{\varphi^n - \psi^n}{\sqrt5}, \qquad F_n = \operatorname{round}\!\left(\frac{\varphi^n}{\sqrt5}\right)

Because ∣ψ∣<1|\psi| < 1, the second term vanishes quickly, so FnF_n is the integer nearest to φn/5\varphi^n/\sqrt5 and Fn+1/Fn→φF_{n+1}/F_n \to \varphi.

For exact values the calculator uses the doubling identities F2k=Fk(2Fk+1−Fk)F_{2k} = F_k(2F_{k+1} - F_k) and F2k+1=Fk2+Fk+12F_{2k+1} = F_k^2 + F_{k+1}^2. With custom starting terms G0,G1G_0, G_1, the n-th term is Gn=G0Fn−1+G1FnG_n = G_0 F_{n-1} + G_1 F_n.

Fibonacci test: a natural number xx is a Fibonacci number if and only if 5x2+45x^2 + 4 or 5x2−45x^2 - 4 is a perfect square.

Worked example

nth term. F10F_{10} = 55, F12F_{12} = 144, F20F_{20} = 6,765 and F50F_{50} = 12,586,269,025. The 100th Fibonacci number has 21 digits: 354224848179261915075. F1000F_{1000} has 209 digits and starts with 4346655768.

Golden ratio. F20/F19=1.618033…F_{20}/F_{19} = 1.618033\ldots, already within one millionth of φ≈1.618034\varphi \approx 1.618034.

Lucas numbers. With F0=2F_0 = 2 and F1=1F_1 = 1 the calculator gives 2, 1, 3, 4, 7, 11, 18, 29, 47, 76 and L10L_{10} = 123.

Sum. Listing F0F_0 to F10F_{10} gives a total of 143, which is F12−1F_{12} - 1.

Test. Is 144 a Fibonacci number? 5×1442+45 \times 144^2 + 4 = 103,684 = 322², a perfect square, so yes: 144=F12144 = F_{12}. For 100, neither 50,004 nor 49,996 is a square, so 100 is not a Fibonacci number; it lies between F11=89F_{11} = 89 and F12=144F_{12} = 144.

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 FnF_n grows roughly by a factor of 1.618 at each step, so the number of digits rises by about log⁡10φ≈0.209\log_{10}\varphi \approx 0.209 per index: FnF_n has close to 0.209 n0.209\,n digits. See the golden ratio calculator to split a length by φ\varphi.

A few useful facts: every third Fibonacci number is even, every fifth is a multiple of 5, and gcd⁡(Fm,Fn)=Fgcd⁡(m,n)\gcd(F_m, F_n) = F_{\gcd(m,n)}. Extended to negative indices, F−n=(−1)n+1FnF_{-n} = (-1)^{n+1} F_n, 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

Last updated:

More Math calculators

People also use