Fibonacci Sequence
Generate the Fibonacci sequence where each number is the sum of the two before it.
Found throughout nature and mathematics.
The Formula
Each Fibonacci number is the sum of the two numbers before it. The sequence begins: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, ...
Binet's closed-form formula: F(n) = (φⁿ - ψⁿ) / √5, where φ = (1+√5)/2 ≈ 1.618 (the golden ratio) and ψ = (1-√5)/2 ≈ -0.618.
Variables
| Symbol | Meaning |
|---|---|
| F(n) | The nth Fibonacci number |
| n | Position in the sequence (starting from 0) |
| φ | Golden ratio (approximately 1.61803) |
Example 1
Find the 10th Fibonacci number
F(0)=0, F(1)=1, F(2)=1, F(3)=2, F(4)=3, F(5)=5
F(6)=8, F(7)=13, F(8)=21, F(9)=34, F(10)=55
F(10) = 55
Example 2
Use Binet's formula to find F(12)
F(12) = (1.618¹² - (-0.618)¹²) / √5
F(12) = (321.997 - 0.00319) / 2.236
F(12) = 144
When to Use It
Use the Fibonacci sequence when:
- Studying patterns in nature (sunflower seeds, pinecones, shells)
- Analyzing algorithm complexity (recursive algorithms)
- Working with the golden ratio in art and architecture
- Applying Fibonacci levels in financial trading