Fibonacci calculator

This Fibonacci calculator finds the nth Fibonacci number up to F(20000) exactly, lists the sequence or checks whether a number belongs to it. F(20) is 6,765 and F(50) already 12,586,269,025.

Example: What would you like to know: nth Fibonacci number · Index n 20 → Result: F(20) = 6,765. Source: Wikipedia – Fibonacci-Folge (Definition, Binet-Formel, Identitäten, Zeckendorf-Satz). Updated: .

F(0) = 0, F(1) = 1, F(2) = 1, F(3) = 2, …
My ToolboxYour inputs are saved in this browser only.

Result

Result
F(20) = 6,765
More values
QuantityValue
Lucas numberL(20) = 15,127
Number of digits4
PredecessorF(19) = 4,181
SuccessorF(21) = 10,946
Sum of all numbers up to there17,710
Ratio F(n+1) / F(n)1.618033998522 (φ + 9.77 × 10⁻⁹)
Divisible by 2no

How it is calculated

Every Fibonacci number is the sum of the two before it: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55 … Formally F(0) = 0, F(1) = 1 and F(n) = F(n−1) + F(n−2).

How it is calculated

For large n the calculator uses the doubling formulas F(2k) = F(k) · (2·F(k+1) − F(k)) and F(2k+1) = F(k)² + F(k+1)². This works with integer arithmetic and no rounding error, even for hundreds of digits. The quotient F(n+1) / F(n) approaches the golden ratio 1.6180339887….

Checking and decomposing

A number x is a Fibonacci number exactly when 5x² + 4 or 5x² − 4 is a perfect square. By Zeckendorf’s theorem every positive integer can be written uniquely as a sum of non-consecutive Fibonacci numbers: 100 = 89 + 8 + 3.

Frequently asked questions

What are the first Fibonacci numbers?

0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377 … Each number is the sum of its two predecessors.

How do you calculate the nth Fibonacci number?

By recursion F(n) = F(n−1) + F(n−2) or faster with the doubling formulas. The calculator gives F(n) exactly up to n = 20,000.

How is the Fibonacci sequence related to the golden ratio?

The quotient of two consecutive numbers approaches φ = 1.618…: 89 / 55 = 1.6182 and 233 / 144 = 1.6181.

Sources and legal basis

As of: · Editorial policy

Related tools