Compute the nth Fibonacci number and display the sequence up to that term.
The Fibonacci sequence is defined by F(0) = 0, F(1) = 1, and F(n) = F(n−1) + F(n−2) for n ≥ 2. The ratio of consecutive terms converges to the golden ratio φ = (1+√5)/2 ≈ 1.618. This calculator uses BigInt for exact computation up to F(1000), which has 209 digits.
Fibonacci recurrence
F(n) = F(n−1) + F(n−2), F(0) = 0, F(1) = 1
Binet's formula (closed form)
F(n) = (φⁿ − ψⁿ) / √5, where φ = (1+√5)/2, ψ = (1−√5)/2
The golden ratio φ = (1 + √5)/2 ≈ 1.6180339887. The ratio F(n)/F(n−1) approaches φ as n grows. It appears throughout mathematics, art and nature.
Fibonacci numbers grow exponentially. F(79) already exceeds Number.MAX_SAFE_INTEGER (2⁵³−1), so standard JavaScript numbers lose precision. BigInt provides exact integer arithmetic regardless of size.