Math · Sequences

Fibonacci calculator.

Get the exact nth Fibonacci number for n up to 100,000, see the first terms of the sequence, or test whether a number belongs to it and which term it is.

n up to 100,000Exact digitsIs it Fibonacci?

Advertisement

Inputs

Result

Enter a number.

The Fibonacci sequence

The Fibonacci numbers start F(0) = 0, F(1) = 1 and every later term is the sum of the previous two: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89 (OEIS A000045). F(10) is 55, F(50) is 12,586,269,025 and F(100) is 354,224,848,179,261,915,075. F(1,000) already has 209 digits.

How it is computed. Adding term by term would take n steps. This tool uses the fast doubling identities F(2k) = F(k) (2F(k+1) - F(k)) and F(2k+1) = F(k)^2 + F(k+1)^2, which need only about log2(n) rounds, with exact big integers. Every result is rechecked as F(n-1) + F(n-2).

Known identities. Binet's formula F(n) = (phi^n - (1 - phi)^n) / sqrt(5) with phi = (1 + sqrt(5)) / 2; gcd(F(n), F(m)) = F(gcd(n, m)); and F(2n+1) x F(2n+3) = F(2n+2)^2 + 1, all listed in OEIS A000045. Binet's formula uses decimals and loses accuracy for large n, which is why this tool does not use it.

Frequently asked questions

What is the 100th Fibonacci number?

354,224,848,179,261,915,075, using F(0) = 0 and F(1) = 1.

Does the sequence start at 0 or 1?

This tool uses F(0) = 0 and F(1) = 1, the convention in OEIS A000045. Some books start at F(1) = 1, F(2) = 1 and leave out F(0); the later numbers are the same.

How do I check if a number is a Fibonacci number?

Choose "Is a number Fibonacci?" and enter it. The tool walks the sequence and reports the index when it finds an exact match.

How many digits does F(1000) have?

209 digits.

Is the golden ratio related?

Yes. The ratio F(n+1) / F(n) approaches the golden ratio, about 1.618, and Binet's formula expresses F(n) with it.

Sources

Checked

The definition, starting terms and identities are from OEIS A000045. F(100) was cross-checked against a straight term-by-term addition in the test suite. Runs in your browser with exact BigInt arithmetic. Runs entirely in your browser. Nothing you type is sent or stored.

For learning

Large results are shown as digits and the first 100 digits; the full number is exact internally.

Advertisement
Advertisement