Fibonacci Calculator
Find the nth Fibonacci number, check if a number is Fibonacci, or generate a sequence. Shows the golden ratio and exact digit count.
🌀 What is the Fibonacci Sequence?
The Fibonacci sequence is one of the most famous number sequences in mathematics: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, ... Each number (called a Fibonacci number) is the sum of the two preceding numbers, starting from 0 and 1. This deceptively simple rule generates a sequence that appears throughout nature, art, and science in ways that have fascinated mathematicians for centuries.
The sequence was named after Leonardo of Pisa, known as Fibonacci, who introduced it to Western mathematics in his 1202 book Liber Abaci through a problem about rabbit population growth. However, Indian mathematicians including Virahanka and Hemachandra had described the sequence centuries earlier in the context of Sanskrit poetry meter. The sequence appears naturally in the arrangement of leaves (phyllotaxis), the number of spirals on sunflower heads (typically 34 and 55), pine cone bracts, and nautilus shell proportions.
A common misconception is that Fibonacci numbers are just a mathematical curiosity. In practice, Fibonacci retracement levels (23.6%, 38.2%, 61.8%) are among the most widely used tools in financial technical analysis. The Fibonacci heap data structure improves Dijkstra's shortest path algorithm. Fibonacci numbers arise in the time complexity of the Euclidean GCD algorithm (consecutive Fibonacci numbers are the worst case). They also connect deeply to the golden ratio φ ≈ 1.618, which appears in aesthetics, architecture, and biology.
This calculator handles three modes: find any specific Fibonacci number F(n) up to F(1000) (a 209-digit number) using JavaScript's BigInt for exact arithmetic; check whether any positive integer is a Fibonacci number by searching the sequence; and generate complete sequences between any two indices for tables and analysis.
📐 Formula
📖 How to Use This Calculator
Steps
💡 Example Calculations
Example 1 — Finding the 10th Fibonacci Number
What is F(10)?
Example 2 — Is 144 a Fibonacci Number?
Check: is 144 in the Fibonacci sequence?
Example 3 — Large Fibonacci: F(50)
What is F(50) and how many digits does it have?
❓ Frequently Asked Questions
🔗 Related Calculators
What is the Fibonacci sequence?
The Fibonacci sequence is 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ... where each term is the sum of the two preceding terms. It starts with F(0) = 0 and F(1) = 1. Named after Leonardo of Pisa (Fibonacci), who introduced it to Europe in 1202, the sequence arises naturally in botany, art, financial markets, and number theory.
What is Binet's formula for Fibonacci numbers?
Binet's formula gives F(n) = (φⁿ − ψⁿ) / √5, where φ = (1 + √5)/2 ≈ 1.618 (golden ratio) and ψ = (1 − √5)/2 ≈ −0.618. For large n, |ψⁿ| < 0.5 so F(n) = round(φⁿ / √5). Binet's formula is elegant but loses precision for large n due to floating-point errors; iterative methods are used for n > 70.
What is the golden ratio and how does it relate to Fibonacci?
The golden ratio φ = (1 + √5)/2 ≈ 1.6180339887... As n increases, F(n)/F(n−1) → φ. For example: F(10)/F(9) = 55/34 ≈ 1.6176, F(20)/F(19) = 6765/4181 ≈ 1.61803. The golden ratio appears in art, architecture, and nature and is deeply connected to the Fibonacci sequence through this ratio property.
How do you check if a number is a Fibonacci number?
A positive integer m is a Fibonacci number if and only if 5m² + 4 or 5m² − 4 is a perfect square. For example: m = 13 → 5(169) + 4 = 849 (not perfect square) and 5(169) − 4 = 841 = 29² ✓, so 13 is F(7). This test works for any size integer without generating the whole sequence.
What are some real-world applications of Fibonacci numbers?
Fibonacci numbers appear in plant spiral patterns (sunflower seeds, pine cones, pineapple scales), stock market technical analysis (Fibonacci retracement levels at 23.6%, 38.2%, 61.8%), computer algorithms (Fibonacci heaps, Fibonacci search), music theory (octave intervals), and cryptography. The 61.8% level (1/φ) is widely used in trading as a support/resistance indicator.
What is the Pisano period?
The Pisano period π(m) is the period with which Fibonacci numbers repeat modulo m. For example, F(n) mod 2 repeats with period 3: 0, 1, 1, 0, 1, 1, ... F(n) mod 10 (last digit) repeats with period 60. The Pisano period is used in competitive programming to compute F(n) mod m for astronomically large n efficiently.
How many digits does the nth Fibonacci number have?
F(n) has ⌊n × log₁₀(φ)⌋ + 1 = ⌊0.20898n⌋ + 1 digits. So F(100) has about 21 digits, F(1000) about 209 digits, and F(10000) about 2090 digits. This is because F(n) ≈ φⁿ/√5, so log₁₀(F(n)) ≈ n × log₁₀(φ) − log₁₀(√5) ≈ 0.20898n − 0.349.
What is a Fibonacci spiral?
A Fibonacci spiral is constructed by drawing quarter-circle arcs through squares whose side lengths are consecutive Fibonacci numbers (1, 1, 2, 3, 5, 8, 13, ...). As the squares grow, the spiral approximates a golden spiral - one whose growth factor per quarter turn is φ. Fibonacci spirals appear in nautilus shells, galaxy arm patterns, and hurricane formations.
Are there negative Fibonacci numbers?
Yes - the sequence can be extended to negative indices using F(−n) = (−1)ⁿ⁺¹ F(n). So F(−1) = 1, F(−2) = −1, F(−3) = 2, F(−4) = −3, F(−5) = 5, ... This is called the negafibonacci sequence. The recurrence F(n−2) = F(n) − F(n−1) extends naturally to the left.
What is the fastest algorithm to compute large Fibonacci numbers?
The matrix exponentiation method computes F(n) in O(log n) matrix multiplications using the identity [[1,1],[1,0]]^n = [[F(n+1),F(n)],[F(n),F(n−1)]]. Combined with fast bignum arithmetic, this computes F(1,000,000) in under a second. For this calculator, simple iterative addition (O(n)) is used, which gives exact BigInt results up to F(1000).