Fibonacci Sequence Calculator
The Fibonacci sequence is one of the most famous sequences in mathematics. Each number is the sum of the two preceding numbers, starting from F(0) = 0 and F(1) = 1: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, ... The sequence is named after Leonardo of Pisa (Fibonacci), who described it in 1202 in the context of rabbit population growth. Fibonacci numbers appear in nature (spirals in sunflowers and pine cones), in algorithm analysis (Euclid's algorithm worst case), and in financial markets. This calculator uses the iterative method for accuracy with large n. Enter n to compute F(n) and see the full sequence up to that term.
Fibonacci recurrence and Binet's formula
F(0) = 0, F(1) = 1
F(n) = F(n-1) + F(n-2) for n >= 2
Binet: F(n) = (phi^n - psi^n) / sqrt(5), phi = (1+sqrt(5))/2
The iterative method computes exact integer values up to F(75) within standard 64-bit floating-point precision. Binet's formula provides an exact closed form but accumulates rounding error for large n due to irrational numbers.
Fibonacci number properties
- Every third Fibonacci number is even; all others are odd.
- GCD(F(m), F(n)) = F(GCD(m, n)) for any positive m, n.
- The sum of the first n Fibonacci numbers equals F(n+2) - 1.
- The ratio F(n+1)/F(n) converges to the golden ratio phi as n increases.
- Zeckendorf's theorem: every positive integer has a unique representation as a sum of non-consecutive Fibonacci numbers.
Fibonacci calculator: frequently asked questions
What is the Fibonacci sequence?
The Fibonacci sequence is the infinite sequence 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, ... where each term is the sum of the two preceding terms. By convention, F(0) = 0 and F(1) = 1.
Is there a direct formula for the nth Fibonacci number?
Yes. Binet's formula gives F(n) = (phi^n - psi^n) / sqrt(5), where phi = (1 + sqrt(5))/2 is the golden ratio (approximately 1.618) and psi = (1 - sqrt(5))/2. For exact integer results, iterative computation is more reliable for large n.
What is the golden ratio?
The golden ratio phi = (1 + sqrt(5))/2 approximately equals 1.61803. As n grows, the ratio F(n+1)/F(n) converges to phi. The golden ratio appears in art, architecture, and nature, but these occurrences are often aesthetic choices rather than mathematical necessities.
What is the Fibonacci sequence used for in mathematics?
Fibonacci numbers appear in the analysis of algorithms (e.g., Euclid's algorithm worst case), counting paths in lattices, the structure of Pascal's triangle (diagonal sums), and number theory (e.g., every positive integer is a sum of distinct Fibonacci numbers, Zeckendorf's theorem).
Can Fibonacci numbers be extended to negative indices?
Yes. The negafibonacci sequence extends to negative indices with the rule F(-n) = (-1)^(n+1) * F(n). For example, F(-1) = 1, F(-2) = -1, F(-3) = 2, following the same recurrence applied backwards.
Official sources
- NIST Digital Library of Mathematical Functions: dlmf.nist.gov.
- NIST, Mathematical topics: nist.gov/topics/mathematics.
Reviewed by the CalculatorHub team, edited by James Graham, 15 June 2026. See our methodology.