The fibonacci sequence calculator lets you calculate the $\hspace{0.2em} n^{\text{th}} \hspace{0.2em}$term in the fibonacci sequence. You can also use it to get the numbers in the fibonacci sequence between two positions. Or check whether a number appears in the sequence.

Here's a quick overview of what the fibonacci sequence is.

## Fibonacci Sequence

Fibonacci sequence is a sequence in which each term (except the first two) is the sum of the two preceding terms. Most commonly, the first two terms are taken to be $\hspace{0.2em} 0 \hspace{0.2em}$ (zeroth term) and $\hspace{0.2em} 1 \hspace{0.2em}$ (first term).

The terms in a Fibonacci sequence are known as Fibonacci numbers and are denoted by $\hspace{0.2em} F_n \hspace{0.2em}$.

The first few terms of the Fibonacci sequence are —

$\hspace{0.2em} 0 \hspace{0.2em}$, $\hspace{0.2em} 1 \hspace{0.2em}$, $\hspace{0.2em} 1 \hspace{0.2em}$, $\hspace{0.2em} 2 \hspace{0.2em}$, $\hspace{0.2em} 3 \hspace{0.2em}$, $\hspace{0.2em} 5 \hspace{0.2em}$, $\hspace{0.2em} 8 \hspace{0.2em}$, and $\hspace{0.2em} 13 \hspace{0.2em}$

Put differently, if $\hspace{0.2em} F_n \hspace{0.2em}$ is the $\hspace{0.2em} n^{\text{th}} \hspace{0.2em}$ term of the Fibonacci sequence —

$F_0 = 0 \hspace{0.2em}$, $\hspace{0.2em} F_1 = 1 \hspace{0.2em}$, and $\hspace{0.2em} F_{n + 1} = F_n + F_{n - 1} \hspace{0.5em} (n > 1) \hspace{0.2em}$

For example,

$\begin{align*} F_2 \hspace{0.25em} &= \hspace{0.25em} F_1 + F_0 \\[1em] &= \hspace{0.25em} 1 + 0 \\[1em] &= \hspace{0.25em} 1 \end{align*}$

Similarly,

$\begin{align*} F_3 \hspace{0.25em} &= \hspace{0.25em} F_2 + F_1 \\[1em] &= \hspace{0.25em} 1 + 1 \\[1em] &= \hspace{0.25em} 2 \end{align*}$

We can use this formula to extend the fibonacci sequence backwards too (meaning, to find $\hspace{0.2em} F_n \, , \hspace{0.5em} n < 0 \hspace{0.2em}$). As an example,

$\begin{align*} F_1 \hspace{0.25em} &= \hspace{0.25em} F_0 + F_{-1} \\[1em] 1 \hspace{0.25em} &= \hspace{0.25em} 0 + F_{-1} \\[1em] F_{-1} \hspace{0.25em} &= \hspace{0.25em} 1 \end{align*}$

The formula discussed above may not be the super helpful if we want the value of anything beyond the first few terms, say, $\hspace{0.2em} F_{84} \hspace{0.2em}$ — the $\hspace{0.2em} 84^{\text{th}} \hspace{0.2em}$ fibonacci term.

Thankfully, we have a formula that gives us the value for any arbitrary fibonacci term, $\hspace{0.2em} F_n \hspace{0.2em}$.

$F_n \hspace{0.25em} = \hspace{0.25em} \frac{\varphi^n - \psi^n}{\sqrt{5}}$

Here $\hspace{0.2em} \varphi \hspace{0.2em}$ is the golden ratio.

$\begin{align*} \varphi \hspace{0.25em} &= \hspace{0.25em} \frac{1 + \sqrt{5}}{2} \\[1.5em] &\approx \hspace{0.25em} 1.61803 \end{align*}$

And $\hspace{0.2em} \psi \hspace{0.2em}$ is its conjugate.

$\begin{align*} \psi \hspace{0.25em} &= \hspace{0.25em} \frac{1 - \sqrt{5}}{2} \\[1.5em] &\approx \hspace{0.25em} -0.61803 \end{align*}$

## First $\hspace{0.2em} 100 \hspace{0.2em}$ Fibonacci Terms