Fibonacci Sequence and Number Calculator

Fibonacci Sequence and Number Calculator

Emerging AI Skill PRO

Enter Calculation

Formula

Fn=Fn−1+Fn−2where{F0=0,F1=1F−m=(−1)m+1Fmn∈[−200,200]\begin{gathered} F_{\text{n}} = F_{\text{n}-1} + F_{\text{n}-2} \\[1.5em] \text{where}\quad \left\{ \begin{aligned} F_0 &= 0,\quad F_1 = 1 \\ F_{-m} &= (-1)^{m+1} F_m \\ \text{n} &\in [-200,\ 200] \end{aligned} \right. \end{gathered}
Usage stats

Advertisement

Results

F10
55
Fibonacci number at index 10
Fn-1 34
Fn-2 21

Report an error on this page

What is the Fibonacci sequence?

The Fibonacci sequence is a series of integers in which every number is the sum of the two preceding ones, starting from 0 and 1: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, and so on. It appears throughout mathematics and nature, from spiral shells and sunflower seed heads to the golden ratio. This calculator can return a single Fibonacci number \(F_n\) for any index \(n\), or generate the whole sequence between a start and end index.

Fibonacci sequence as a row of squares whose side lengths grow following the Fibonacci numbers, with a spiral arc through them
Each Fibonacci number is the sum of the two before it, forming the classic square tiling and spiral.

How to use this calculator

Choose a mode in the Generate dropdown. Select one Number and enter an index \(n\) to get the single value \(F_n\) together with its recurrence step. Select a Sequence and enter a Start \(n\) and End \(n\) to list every Fibonacci number across that inclusive range. Indices may be positive or negative; supported range is from -200 to 200.

The formula explained

The defining rule is the recurrence $$F_n = F_{n-1} + F_{n-2}, \quad F_0 = 0, \; F_1 = 1$$ For exact results with large \(n\) this tool iterates using arbitrary-precision integers rather than the floating-point Binet formula, which loses accuracy beyond about \(n = 71\). Negative indices follow the negafibonacci rule \(F_{-n} = (-1)^{n+1} F_n\), so \(F_{-1} = 1\), \(F_{-2} = -1\), \(F_{-3} = 2\), \(F_{-4} = -3\), and so on.

Advertisement
Diagram showing F_n built from the two previous terms F_n-1 and F_n-2 added together
Each term equals the sum of the two preceding terms.

Worked example

To find \(F_{15}\), iterate the sequence up to index 15: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610. So $$F_{15} = 610 = F_{14} + F_{13} = 377 + 233 = 610$$

Fibonacci Numbers Reference Table (F0 to F30 and Negative Indices)

The Fibonacci sequence is defined by \(F_0 = 0\), \(F_1 = 1\) and \(F_n = F_{n-1} + F_{n-2}\). The table lists the first 31 terms.

n Fn n Fn n Fn
0 0 11 89 22 17711
1 1 12 144 23 28657
2 1 13 233 24 46368
3 2 14 377 25 75025
4 3 15 610 26 121393
5 5 16 987 27 196418
6 8 17 1597 28 317811
7 13 18 2584 29 514229
8 21 19 4181 30 832040
9 34 20 6765
10 55 21 10946

Negative indices

The sequence extends backwards using \(F_{-m} = (-1)^{m+1} F_m\). Odd \(m\) gives a positive value and even \(m\) gives a negative value.

n Fn Sign rule (-1)m+1, m = |n|
-1 1 m = 1, sign +
-2 -1 m = 2, sign −
-3 2 m = 3, sign +
-4 -3 m = 4, sign −
-5 5 m = 5, sign +
-6 -8 m = 6, sign −
-7 13 m = 7, sign +
-8 -21 m = 8, sign −
-9 34 m = 9, sign +
-10 -55 m = 10, sign −
Advertisement

How to Compute Fibonacci Numbers by Hand

  1. Start with the two seed values \(F_0 = 0\) and \(F_1 = 1\).
  2. Add the previous two terms to get the next: \(F_2 = F_1 + F_0 = 1\), \(F_3 = F_2 + F_1 = 2\), \(F_4 = 3\), \(F_5 = 5\), and so on.
  3. Repeat until you reach index n. For \(n = 10\): 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, so \(F_{10} = 34 + 21 =\) 55.
  4. For a negative index, compute \(m = |n|\), find \(F_m\), then apply the sign \((-1)^{m+1}\). Example: \(F_{-7} = (-1)^{8} F_7 = (+1)(13) =\) 13. Another: \(F_{-6} = (-1)^{7} F_6 = -8\).
  5. Sanity check with the golden ratio: \(F_n \approx \varphi^n/\sqrt{5}\). For \(n = 10\), \(\varphi^{10} \approx 122.99\) and \(122.99 / 2.23607 \approx 55.0\), which matches. Also \(F_{n+1}/F_n\) should be close to 1.618 for larger n.
  6. For very large n, use fast doubling instead of adding term by term: \(F_{2k} = F_k\,(2F_{k+1} - F_k)\) and \(F_{2k+1} = F_k^2 + F_{k+1}^2\). Check with \(k = 5\): \(F_{10} = F_5(2F_6 - F_5) = 5 \times (16 - 5) = 55\).

Values grow fast: \(F_{100}\) already has 21 digits, so exact integer arithmetic is needed for large n (this calculator supports n from −200 to 200).

FAQ

Does it support negative indices? Yes. It uses the negafibonacci extension, producing alternating-sign results such as \(F_{-6} = -8\).

How large can n be? The supported range is -200 to 200. \(F_{200}\) has 42 digits and is computed exactly with arbitrary-precision integers.

Why not just use Binet's formula? Binet's closed form \(F_n = \frac{\varphi^n - \psi^n}{\sqrt{5}}\) is elegant for display, but double-precision rounding makes it unreliable for large \(n\), so exact integer iteration is used for the answer.

Last updated:

Most popular in Math and Statistics

View all Math and Statistics calculators