Fibonacci Recurrence
F(n) = F(n-1) + F(n-2), with F(0) = 0, F(1) = 1Each Fibonacci number is the sum of the two preceding numbers in the sequence.
Where:
F(n)= The nth Fibonacci numbern= Position in the sequence (0-indexed)F(10)
55
Terms
11
φ (phi)
1.618034
Enter 0–78. Generates the sequence F(0) through F(n).
Uses the property that n is Fibonacci if 5n²±4 is a perfect square.
55
1.61803399
55
F(n) = F(n-1) + F(n-2), with F(0) = 0, F(1) = 1Each Fibonacci number is the sum of the two preceding numbers in the sequence.
Where:
F(n)= The nth Fibonacci numbern= Position in the sequence (0-indexed)F(n) = (φⁿ - ψⁿ) / √5Direct formula using the golden ratio, avoiding iterative computation.
Where:
φ= (1 + √5) / 2 ≈ 1.618 (golden ratio)ψ= (1 - √5) / 2 ≈ -0.618 (conjugate)√5= Square root of 5 ≈ 2.236φ = (1 + √5) / 2 ≈ 1.6180339887...The limit of F(n+1)/F(n) as n approaches infinity. An irrational number with unique mathematical properties.
Where:
φ= Phi, the golden ratio√5= Square root of 5Inputs
Result
F(10) = F(9) + F(8) = 34 + 21 = 55. The ratio 55/34 ≈ 1.6176 is close to the golden ratio 1.6180.
Inputs
Result
F(20) = 6,765. The ratio F(20)/F(19) = 6765/4181 = 1.6180339... matches the golden ratio to 7 decimal places.
Inputs
Result
5 × 144² + 4 = 5 × 20,736 + 4 = 103,684 = 322². Since this is a perfect square, 144 is a Fibonacci number (F(12)).
The Fibonacci sequence starts with 0 and 1, and each subsequent number is the sum of the two preceding ones: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, and so on. It was introduced to Western mathematics by Leonardo of Pisa (Fibonacci) in 1202.
| n | F(n) | Calculation |
|---|---|---|
| 0 | 0 | Base case |
| 1 | 1 | Base case |
| 5 | 5 | 3 + 2 |
| 10 | 55 | 34 + 21 |
| 20 | 6,765 | 4,181 + 2,584 |
The golden ratio (phi, φ) equals (1 + √5) / 2, approximately 1.6180339887. The ratio of consecutive Fibonacci numbers F(n+1)/F(n) converges to phi as n increases. By F(10)/F(9) = 55/34 = 1.6176..., it is already accurate to 3 decimal places.
| Ratio | Value | Error from φ |
|---|---|---|
| F(5)/F(4) = 5/3 | 1.6667 | 0.0486 |
| F(8)/F(7) = 21/13 | 1.6154 | 0.0027 |
| F(10)/F(9) = 55/34 | 1.6176 | 0.0004 |
| F(15)/F(14) = 610/377 | 1.61803 | 0.00001 |
Binet's formula computes F(n) directly without iteration: F(n) = (φ^n - ψ^n) / √5, where φ = (1+√5)/2 and ψ = (1-√5)/2. Since |ψ| < 1, the ψ^n term shrinks rapidly, so F(n) ≈ round(φ^n / √5) for n >= 0.
| n | Iterative F(n) | Binet Formula | Match |
|---|---|---|---|
| 5 | 5 | 5.000 | Yes |
| 10 | 55 | 55.000 | Yes |
| 20 | 6,765 | 6,765.000 | Yes |
| 30 | 832,040 | 832,040.000 | Yes |
A positive integer n is a Fibonacci number if and only if 5n² + 4 or 5n² - 4 is a perfect square. For example, 13: 5(169) + 4 = 849 (not square), 5(169) - 4 = 841 = 29² (perfect square), so 13 is Fibonacci.
| Number | 5n²+4 | 5n²-4 | Fibonacci? |
|---|---|---|---|
| 8 | 324 = 18² | 316 | Yes |
| 13 | 849 | 841 = 29² | Yes |
| 14 | 984 | 976 | No |
| 21 | 2209 = 47² | 2201 | Yes |
Fibonacci numbers appear in many natural phenomena: the number of petals on flowers (lilies have 3, buttercups 5, daisies 13 or 21), spiral patterns in sunflower heads and pinecones, and the branching of trees. The golden spiral based on Fibonacci rectangles models nautilus shells.
| Natural Phenomenon | Fibonacci Numbers | Pattern |
|---|---|---|
| Lily petals | 3 | Petal count |
| Sunflower | 34, 55 | Opposing spirals |
| Pinecone | 8, 13 | Opposing spirals |
| Pineapple | 8, 13, 21 | Hexagonal scales |
F(10) = 55, F(20) = 6,765, and F(50) = 12,586,269,025 — the sequence grows exponentially because each term is the sum of the two before it. Starting from F(0) = 0 and F(1) = 1, the rule F(n) = F(n−1) + F(n−2) generates every subsequent number. Leonardo of Pisa introduced this recurrence in his 1202 book Liber Abaci to model rabbit population growth under idealized conditions.
The first 15 terms are 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377. By F(30) the numbers exceed 800,000, and by F(100) they surpass 3.54 × 10²⁰. This rapid growth makes iterative computation expensive for large n, which is why Binet’s closed-form formula becomes essential for direct calculation.
Every positive integer can be represented as a sum of non-consecutive Fibonacci numbers — a result known as Zeckendorf’s theorem. For example, 100 = 89 + 8 + 3. This property is the basis for Fibonacci coding, a data compression scheme used in some search engine indexing systems.
| n | F(n) | F(n)/F(n−1) | Digits |
|---|---|---|---|
| 5 | 5 | 1.6667 | 1 |
| 10 | 55 | 1.6176 | 2 |
| 20 | 6,765 | 1.6180340 | 4 |
| 30 | 832,040 | 1.6180340 | 6 |
| 50 | 12,586,269,025 | 1.6180339887 | 11 |
The golden ratio φ = (1 + √5) / 2 ≈ 1.6180339887 is the limit of F(n+1)/F(n) as n increases. By F(10)/F(9) = 55/34 = 1.6176, the ratio already matches φ to 3 decimal places. By F(20)/F(19) = 6,765/4,181, the match extends to 7 decimal places. This convergence is not gradual — the error halves roughly every term.
Binet’s formula makes the connection explicit: F(n) = (φⁿ − ψⁿ) / √5, where ψ = (1 − √5)/2 ≈ −0.618. Since |ψ| < 1, the term ψⁿ shrinks to zero, so F(n) ≈ round(φⁿ / √5) for all n ≥ 0. This gives O(1) computation of any Fibonacci number, though floating-point precision limits accuracy beyond roughly F(70) on standard 64-bit hardware.
The golden ratio appears in geometry, art, and architecture. A golden rectangle (sides in ratio φ:1) can be subdivided into a square and a smaller golden rectangle indefinitely, generating the golden spiral. The Ratio Calculator can verify golden ratio proportions in design work, and the Logarithm Calculator helps compute how many Fibonacci terms are needed to reach a given magnitude.
Sunflower heads contain 34 clockwise and 55 counterclockwise spirals — two consecutive Fibonacci numbers. Pinecones typically show 8 and 13 spirals, pineapples display 8, 13, and 21 hexagonal scales, and flower petals overwhelmingly come in Fibonacci counts: lilies have 3, buttercups 5, delphiniums 8, marigolds 13, daisies 21 or 34.
In computer science, Fibonacci numbers appear in algorithm analysis. Fibonacci heaps achieve O(1) amortized insert and decrease-key operations, making them optimal for Dijkstra’s shortest-path algorithm. Fibonacci search divides arrays using Fibonacci ratios instead of halving, which can outperform binary search on hardware where comparison is cheaper than division.
Financial analysts use Fibonacci retracement levels (23.6%, 38.2%, 50%, 61.8%) derived from ratios within the sequence to identify potential support and resistance in price charts. The 61.8% level comes directly from the golden ratio: 1/φ = 0.618. While not scientifically proven as predictive, these levels are self-reinforcing because millions of traders watch the same numbers.
| Domain | Fibonacci Application | Specific Numbers |
|---|---|---|
| Botany | Spiral phyllotaxis | 3, 5, 8, 13, 21, 34, 55 |
| CS: Data Structures | Fibonacci heaps | O(1) amortized insert |
| CS: Search | Fibonacci search | Array partitioning by F(n) |
| Finance | Retracement levels | 23.6%, 38.2%, 61.8% |
A positive integer n is a Fibonacci number if and only if 5n² + 4 or 5n² − 4 is a perfect square. For 144: 5 × 20,736 + 4 = 103,684 = 322², confirming F(12) = 144. For 14: 5 × 196 + 4 = 984 and 5 × 196 − 4 = 976 — neither is a perfect square, so 14 is not Fibonacci.
This test runs in O(1) time with basic arithmetic, making it far faster than generating the sequence up to n. The Square Root Calculator can help verify whether the test values are perfect squares when working by hand. For the 100 integers from 1 to 100, only 10 are Fibonacci numbers (1, 2, 3, 5, 8, 13, 21, 34, 55, 89), illustrating how sparse the sequence becomes as numbers grow.
The density of Fibonacci numbers among all integers approaches zero. Among the first N integers, approximately log₁₀(N) / log₁₀(φ) are Fibonacci numbers — roughly 2.08 × log₁₀(N). For N = 1,000,000, that is only 30 Fibonacci numbers.
Last Updated: Mar 26, 2026
This calculator is provided for informational and educational purposes only. Results are estimates and should not be considered professional financial, medical, legal, or other advice. Always consult a qualified professional before making important decisions. UseCalcPro is not responsible for any actions taken based on calculator results.