Fibonacci Calculator
Result:
Calculate Fibonacci numbers and generate complete sequences with our free online Fibonacci calculator. Discover the mathematical beauty of this famous sequence and its connection to the golden ratio.
What is the Fibonacci Sequence?
The Fibonacci sequence is a series of numbers where each number is the sum of the two preceding ones. Starting with 0 and 1, the sequence continues: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, ...
Fibonacci Formula
F(n) = F(n-1) + F(n-2)
Base cases: F(0) = 0, F(1) = 1
Binet's Formula: F(n) = (φⁿ - ψⁿ) / √5
Fibonacci Properties
Mathematical Properties
- F(0) = 0, F(1) = 1
- Recursive: F(n) = F(n-1) + F(n-2)
- Golden Ratio: F(n+1)/F(n) → φ ≈ 1.618
- Parity: F(n) is even if n is divisible by 3
- GCD: gcd(F(m), F(n)) = F(gcd(m, n))
Growth Pattern
- Exponential growth: F(n) ≈ φⁿ/√5
- Doubling: Every ~4.8 terms
- Growth rate: Approximately 61.8% per term
- Lucas numbers: Similar sequence with different start
- Tribonacci: Extension with three terms
Step-by-Step Fibonacci Examples
Problem: Find the 8th Fibonacci number
Step-by-step calculation:
F(0) = 0, F(1) = 1
F(2) = F(1) + F(0) = 1 + 0 = 1
F(3) = F(2) + F(1) = 1 + 1 = 2
F(4) = F(3) + F(2) = 2 + 1 = 3
F(5) = F(4) + F(3) = 3 + 2 = 5
F(6) = F(5) + F(4) = 5 + 3 = 8
F(7) = F(6) + F(5) = 8 + 5 = 13
F(8) = F(7) + F(6) = 13 + 8 = 21
Result: F(8) = 21
Observe how ratios converge to φ:
n | F(n) | F(n+1) | F(n+1)/F(n) |
---|---|---|---|
1 | 1 | 1 | 1.000000 |
2 | 1 | 2 | 2.000000 |
3 | 2 | 3 | 1.500000 |
4 | 3 | 5 | 1.666667 |
5 | 5 | 8 | 1.600000 |
10 | 55 | 89 | 1.618182 |
15 | 610 | 987 | 1.618033 |
Golden Ratio φ = 1.618033988...
Calculate F(10) using Binet's Formula:
Formula: F(n) = (φⁿ - ψⁿ) / √5
Where φ = (1 + √5)/2 ≈ 1.618, ψ = (1 - √5)/2 ≈ -0.618
Calculation:
F(10) = (1.618¹⁰ - (-0.618)¹⁰) / √5
F(10) = (122.97 - 0.008) / 2.236
F(10) = 122.96 / 2.236 ≈ 55
Result: F(10) = 55 (exact)
Common Fibonacci Values
Position (n) | F(n) | Ratio F(n)/F(n-1) | Properties |
---|---|---|---|
0 | 0 | - | Base case |
1 | 1 | ∞ | Base case |
2 | 1 | 1.000 | First repeat |
3 | 2 | 2.000 | First prime |
4 | 3 | 1.500 | Prime |
5 | 5 | 1.667 | Prime |
6 | 8 | 1.600 | First even > 2 |
7 | 13 | 1.625 | Prime |
8 | 21 | 1.615 | 3 × 7 |
9 | 34 | 1.619 | 2 × 17 |
10 | 55 | 1.618 | 5 × 11 |
Fibonacci in Nature
Plant Life
- Flower petals (3, 5, 8, 13, 21, 34)
- Pinecone spirals
- Sunflower seed arrangements
- Tree branching patterns
- Leaf arrangements (phyllotaxis)
Animal Kingdom
- Nautilus shell chambers
- Honeybee family trees
- Rabbit breeding patterns
- Spiral shells and horns
- DNA molecule structure
Physical World
- Galaxy spiral arms
- Hurricane and tornado patterns
- Crystal formations
- Wave interference patterns
- Mountain ridge formations
Applications of Fibonacci Numbers
Mathematics & Science
- Number Theory: Prime testing, divisibility rules
- Algorithm Design: Dynamic programming examples
- Chaos Theory: Recursive system modeling
- Physics: Quantum mechanics, crystal structures
- Biology: Population models, genetic algorithms
Art & Design
- Golden Rectangle: Architectural proportions
- Art Composition: Rule of thirds, divine proportion
- Music Theory: Harmonic ratios, rhythm patterns
- Photography: Composition guidelines
- Graphic Design: Layout and spacing
Computing Fibonacci Numbers
Naive Recursion
def fib(n):
if n <= 1:
return n
return fib(n-1) + fib(n-2)
Time: O(2ⁿ) - Very slow
Space: O(n) - Call stack
Dynamic Programming
def fib(n):
if n <= 1: return n
a, b = 0, 1
for i in range(2, n+1):
a, b = b, a + b
return b
Time: O(n) - Linear
Space: O(1) - Optimal
Matrix Exponentiation
def fib_matrix(n):
# [[1,1],[1,0]]^n
# Fast matrix power
return matrix_power(
[[1,1],[1,0]], n
)[0][1]
Time: O(log n) - Fastest
Space: O(log n) - Good
Golden Ratio and Fibonacci
🌟 The Divine Proportion
The Golden Ratio (φ) emerges naturally from Fibonacci numbers:
Mathematical Definition:
- φ = (1 + √5) / 2 ≈ 1.618033988749...
- φ² = φ + 1 (unique property)
- 1/φ = φ - 1 ≈ 0.618033988749...
- Limit: F(n+1)/F(n) → φ as n → ∞
Applications:
- Architecture: Parthenon, pyramids
- Art: Mona Lisa, Last Supper
- Design: Credit cards, book proportions
- Nature: Shell spirals, flower patterns
Frequently Asked Questions (FAQ)
The sequence can start with 0 or 1, depending on convention:
- Modern convention: F(0) = 0, F(1) = 1, F(2) = 1, F(3) = 2, ...
- Historical convention: F(1) = 1, F(2) = 1, F(3) = 2, F(4) = 3, ...
- Our calculator uses: F(0) = 0, F(1) = 1 (modern convention)
- The pattern is the same: Each number is the sum of the previous two
The golden ratio appears as the limit of consecutive Fibonacci ratios:
- As n increases: F(n+1)/F(n) approaches φ ≈ 1.618
- Binet's Formula: F(n) = (φⁿ - ψⁿ)/√5, where ψ = -1/φ
- Golden Rectangle: Ratio of sides equals φ
- Golden Spiral: Created by connecting Fibonacci rectangles
- Nature connection: Many natural patterns follow this ratio
Fibonacci numbers appear surprisingly often in natural patterns:
- Flower petals: Lilies (3), buttercups (5), delphiniums (8), marigolds (13)
- Seed arrangements: Sunflower centers have 21, 34, 55, or 89 spirals
- Tree branches: Branching patterns often follow Fibonacci ratios
- Shell spirals: Nautilus chambers grow in golden ratio proportions
- Pinecones: Spirals going each direction are consecutive Fibonacci numbers
- Human body: Finger ratios, facial proportions
Our calculator can handle up to F(1000), but practical limits vary:
- F(100) ≈ 3.54 × 10²⁰ (very large but manageable)
- F(500) ≈ 1.39 × 10¹⁰⁴ (astronomical number)
- F(1000) ≈ 4.35 × 10²⁰⁸ (requires special handling)
- Growth rate: Each term is approximately 1.618 times the previous
- For estimation: Use Binet's formula F(n) ≈ φⁿ/√5
Yes! The Fibonacci sequence can be extended to negative indices:
- Formula: F(-n) = (-1)^(n+1) × F(n)
- Pattern: ..., 5, -3, 2, -1, 1, 0, 1, 1, 2, 3, 5, ...
- Properties: F(-n) alternates sign based on whether n is odd or even
- Examples: F(-1) = 1, F(-2) = -1, F(-3) = 2, F(-4) = -3
- Applications: Useful in advanced number theory and mathematical proofs
Related Calculators
Find Calculator
Popular Calculators
Other Calculators
