Skip to content
Toolcroft

Fibonacci Sequence Generator - First N, Nth Term & Range

Math Calculators

Generate Fibonacci numbers three ways: list the first N terms, look up the exact Nth Fibonacci number (up to F(10,000) using BigInt), or find all Fibonacci numbers within a numeric range. Includes the golden ratio convergence column.

Count

20

Largest term

4181

20 terms

nF(n)F(n)/F(n-1)
00-
11-
211.0000000000
322.0000000000
431.5000000000
551.6666666667
681.6000000000
7131.6250000000
8211.6153846154
9341.6190476190
10551.6176470588
11891.6181818182
121441.6179775281
132331.6180555556
143771.6180257511
156101.6180371353
169871.6180327869
1715971.6180344478
1825841.6180338134
1941811.6180340557

How to use this tool

  1. Choose a mode. Select "First N" to list the first N Fibonacci numbers, "Nth Term" to look up a single term, or "Range" to find all Fibonacci numbers between two values.
  2. Enter your value. Type a whole-number count N (up to 10,000), a whole-number index, or non-negative integer range bounds. Fractional and exponent-form indices are rejected rather than rounded. The result appears immediately.
  3. Copy or download. Use the Copy or Download buttons to export the sequence as plain text or CSV.

What is the Fibonacci sequence?

The Fibonacci sequence is defined by F(0) = 0, F(1) = 1, and F(n) = F(n−1) + F(n−2) for n ≥ 2. Named after the Italian mathematician Leonardo of Pisa (Fibonacci), the sequence appears throughout mathematics and nature: in the branching of trees, the arrangement of leaves, and the spiral patterns of shells.

Fast-doubling algorithm

Computing F(n) naively requires iterating through all n terms. The fast-doubling algorithm computes F(n) in O(log n) BigInt multiplications using two identities: F(2k) = F(k)(2F(k+1) − F(k)) and F(2k+1) = F(k)² + F(k+1)². This makes computing F(10,000) (which has 2,090 decimal digits), nearly instantaneous in the browser.

Fibonacci terms in this tool are indexed only by whole numbers. The First N and Nth Term inputs therefore reject fractional values such as 2.4, blank input, nonnumeric text, and exponent-form overflow instead of rounding them to a different index. Counts must be at least 1, and Nth-term indices may start at 0.

The golden ratio

As n grows, the ratio F(n)/F(n−1) converges to the golden ratio φ = (1 + √5)/2 ≈ 1.6180339887…. This irrational number appears throughout geometry, architecture, and art. The ratio column in the table shows how quickly the Fibonacci sequence approximates φ.

Fibonacci in nature

Fibonacci numbers appear throughout the natural world as solutions to optimal packing problems:

  • Phyllotaxis: the spiral arrangement of leaves, seeds, and petals in plants follows Fibonacci numbers to maximize exposure to sunlight and space.
  • Sunflower spirals: the seeds of a sunflower head form two interlocking spiral patterns - typically 34 clockwise and 55 counterclockwise, or 55 and 89.
  • Pinecone scales: scales are arranged in 8 and 13 spirals, or 13 and 21 spirals depending on species.
  • Nautilus shell: the chambers of a nautilus grow at a ratio approximating the golden ratio, forming a logarithmic spiral.

Applications in technology

  • Fibonacci heaps: a data structure with amortized O(log n) decrease-key and delete operations, used in Dijkstra's and Prim's algorithms.
  • Fibonacci search: a divide-and-conquer search algorithm that splits arrays using Fibonacci numbers instead of halves.
  • Fibonacci retracement: a technical analysis tool in trading that uses ratios derived from the golden ratio (23.6%, 38.2%, 61.8%) to identify potential support and resistance levels.

Lucas numbers

The Lucas sequence (2, 1, 3, 4, 7, 11, 18, 29…) uses the same recurrence relation as Fibonacci (L(n) = L(n−1) + L(n−2)) but starts with L(0) = 2 and L(1) = 1. Like Fibonacci numbers, successive Lucas numbers converge to the golden ratio, and the two sequences share deep mathematical relationships: F(n) = L(n−1) + L(n+1) divided by 5.

Frequently asked questions

What is the Fibonacci sequence?

The Fibonacci sequence is a series of numbers where each term is the sum of the two preceding terms, starting from 0 and 1: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, … It appears throughout nature, art, and mathematics.

How does the calculator handle very large Fibonacci numbers?

This calculator uses JavaScript BigInt for all computations, giving exact integer results for any index up to 10,000. The 10,000th Fibonacci number has 2,090 digits. For the Nth-term mode, the value can be copied in full even if the display is truncated.

What is the golden ratio connection?

As Fibonacci numbers grow, the ratio F(n)/F(n−1) converges to the golden ratio φ ≈ 1.6180339887. This ratio is irrational and appears throughout geometry, art, and nature. The ratio column in this calculator shows how quickly the sequence converges.

What algorithm does the calculator use for large indices?

The calculator uses the fast-doubling algorithm, which computes F(n) in O(log n) steps using the identities F(2k) = F(k)(2F(k+1) − F(k)) and F(2k+1) = F(k)² + F(k+1)². This is much faster than naive iteration for large indices.

Why are fractional indices rejected?

The sequence is defined here only at whole-number indices. First-N counts must be positive integers and Nth-term indices must be non-negative integers, so values such as 2.4 are rejected rather than rounded to a different request. The first-N and Nth-term modes are capped at 10,000.

Browse all math calculators