Audited 29 Jul 2026·Last updated 28 Oct 2026·5 citations·Tier 1·0 uses

Fibonacci Calculator

Exact Fibonacci or Lucas number for any index from 0 to 300, with the terms either side, the running sum, digit count and the ratio's gap from φ.

Fibonacci Calculator

Which sequence?
Counting from 0: F(0) = 0, F(1) = 1, F(2) = 1. Capped at 300, where the exact value already runs to 63 digits.
Exact value
6765
The nth term as a whole number written out in full, every digit correct at any index from 0 to 300.
As a number
6,765
Previous term
4,181
Next term
10,946
Sum of terms 0 through n
17,710
Digits
4
Sequence
0, 1, 1, 2, 3, 5, …, 6765 (terms F(0) through F(20))
Ratio to the previous term
F(20) ⁄ F(19) = 6765 ⁄ 4181 = 1.6180339632, which sits 2.558e-8 away from φ = 1.6180339887.

Background.

What is the 100th Fibonacci number? Run the obvious loop with ordinary floating-point numbers, the default in most programming languages, and the number you end up holding is 354,224,848,179,261,997,056. The true value is 354,224,848,179,261,915,075. The first sixteen digits agree and the last five are wrong, and nothing in the faulty answer warns you. That is the practical reason to compute these numbers carefully: they are easy to define and grow fast enough to break ordinary arithmetic surprisingly early.

The definition takes one line. Start with 0 and 1, and make every new term the sum of the two before it: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144. Each term is roughly 1.618 times the one before, so they pass 2⁵³ at F(79). Beyond 2⁵³ a standard double can no longer store every whole number, and an ordinary number type keeps only a nearby value.

Here the recurrence is carried out in whole numbers that are never rounded, so the exact value at the top of the results is correct to the last digit for every index from 0 up to the cap of 300, where F(300) runs to 63 digits. Alongside it you get the same term as an ordinary number, the terms on either side, the total of every term from index 0, the digit count, a preview of the run, and the ratio of the term to its predecessor set against the golden ratio φ.

The Lucas numbers share the calculator. They obey the identical rule but start from 2 and 1, giving 2, 1, 3, 4, 7, 11, 18, 29, 47, 76, 123, and they are named after Édouard Lucas, the nineteenth-century French mathematician who studied both sequences. The two are bound together: any Lucas number equals the sum of the two Fibonacci numbers on either side of the same index.

The sequence is named after Leonardo of Pisa, whose Liber Abaci of 1202 posed a puzzle about breeding rabbits that these numbers answer. Scholars of Sanskrit prosody had counted the same numbers centuries earlier, while listing the rhythms that can be built from long and short syllables.

What is fibonacci calculator?

The Fibonacci numbers are the integers defined by F(0) = 0, F(1) = 1 and F(n) = F(n−1) + F(n−2) for every n of 2 or more. MathWorld defines the sequence from F(1) = F(2) = 1 and adds F(0) = 0 by convention; the OEIS registers it as A000045 with offset 0, the numbering used here. Every term depends on two predecessors rather than one, so the sequence is neither arithmetic nor geometric, yet it has a closed form, Binet's formula F(n) = (φⁿ − ψⁿ) ⁄ √5, where φ = (1 + √5) ⁄ 2 ≈ 1.618 and ψ = (1 − √5) ⁄ 2 ≈ −0.618. Because ψⁿ shrinks toward zero, F(n) is simply the whole number nearest to φⁿ ⁄ √5: for n = 20 that quotient is 6765.00003. The Lucas numbers L(n) use the same rule with L(0) = 2 and L(1) = 1, and their closed form is even simpler, L(n) = φⁿ + ψⁿ.

How to use this calculator.

  1. Choose Fibonacci or Lucas from the sequence menu. A list beginning 0, 1 or 1, 1 is Fibonacci; one beginning 2, 1, 3, 4 is Lucas.
  2. Enter the index in Index (n), counting from 0. A textbook that calls the opening 1 the first Fibonacci number still matches this numbering for every index of 1 or more, so its tenth term is F(10) = 55 here as well.
  3. Copy the exact value when you need every digit. From F(79) upward the As a number line holds only the nearest value a standard double can store, so it drifts from the exact digits.
  4. Use the previous and next terms to continue the sequence by hand or to test an identity such as Cassini's, and the sum line for the total of every term from index 0 through n.
  5. Keep the index a whole number from 0 to 300. A fractional index has no term, negative indices are outside the calculator's scope, and anything above 300 is refused rather than shown rounded.

The formula.

F(n) = F(n−1) + F(n−2), F(0) = 0, F(1) = 1

The calculation is the definition itself. Starting from the seed pair, F(0) = 0 with F(1) = 1 or L(0) = 2 with L(1) = 1, each step adds the last two terms and shifts along, so reaching index n takes n additions. Working in whole numbers with far more digits than F(300) needs means nothing is ever approximated. Binet's formula would get there in one line, but it passes through irrational numbers and has to be rounded back to an integer at the end, so here it serves only as a cross-check.

The running total follows from rearranging the rule as a(k) = a(k+2) − a(k+1). Adding that for k = 0 to n, almost everything cancels and the sum collapses to a(n+2) − a(1). Both sequences have a(1) = 1, so the terms from index 0 through n always add up to the term two places further on, minus 1. The calculator still adds the terms one by one, which lets the identity act as an independent check.

The ratio a(n) ⁄ a(n−1) heads to φ because ψⁿ dies away in Binet's formula, leaving each term close to φ times the last. It does not approach smoothly from one side: for Fibonacci, an even index gives a ratio just below φ and an odd index one just above, and the gap shrinks by a factor of about φ² ≈ 2.618 at every step. The same growth sets the digit count, which rises by log₁₀ φ ≈ 0.209 per index, so a new digit appears roughly every 4.8 terms: F(50) has 11 digits, F(100) has 21 and F(300) has 63.

Cassini's identity gives a quick test of any three neighbours: F(n−1) × F(n+1) − F(n)² = (−1)ⁿ, so the product of the terms either side differs from the square of the middle one by exactly 1.

A worked example.

Example

Take Fibonacci at index 20. Starting from 0 and 1 and adding the last two terms each time gives 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181 and then 6765, so the exact value is 6765, a 4-digit number. The previous term is 4181, and the next term is 4181 + 6765 = 10946. Adding all twenty-one terms from F(0) to F(20) gives 17710. The shortcut agrees: two places further on, F(22) = 10946 + 6765 = 17711, and 17711 − 1 = 17710. The ratio line divides 6765 by 4181 to get 1.6180339632, which sits 2.558 × 10⁻⁸ below φ = 1.6180339887. Index 20 is even, so the ratio falls just short; at index 21 it overshoots instead. Cassini's identity checks the three neighbours: 4181 × 10946 = 45,765,226 and 6765² = 45,765,225, a difference of exactly 1. The Lucas number at the same index is the sum of the two Fibonacci neighbours, 4181 + 10946 = 15127, which is what the calculator returns with Lucas selected. Multiplying the pair gives 6765 × 15127 = 102,334,155, which is F(40): the identity F(2n) = F(n) × L(n) doubles the index in a single step.

term Index20
sequence Typefibonacci

Frequently asked questions.

What is the 100th Fibonacci number?
F(100) = 354,224,848,179,261,915,075, a 21-digit integer, counting from F(0) = 0. If you got 354,224,848,179,261,997,056 or something close, your tool used floating-point numbers, which store only about sixteen significant digits; that answer is right for its first sixteen digits and wrong afterwards.
Does the Fibonacci sequence start at 0 or at 1?
Both versions appear in print, and they agree wherever they overlap. Writing the sequence as 1, 1, 2, 3, 5 simply leaves out F(0) = 0; the term called F(10) is 55 either way. The calculator counts from 0, as the OEIS does, so it can also report the term at index 0 and its neighbours.
Why does the ratio of consecutive terms approach 1.618?
Binet's formula writes F(n) as (φⁿ − ψⁿ) ⁄ √5, and since ψ is about −0.618 its powers fade quickly, leaving each term almost exactly φ times the previous one. The approach alternates: 3 ⁄ 2 = 1.5 is below φ, 5 ⁄ 3 ≈ 1.6667 is above, 8 ⁄ 5 = 1.6 below again, and each gap is about 2.618 times smaller than the last.
How can I tell whether a number is a Fibonacci number?
A positive whole number x is a Fibonacci number exactly when 5x² + 4 or 5x² − 4 is a perfect square. For 144, 5 × 144² + 4 = 103,684 = 322², so it qualifies; for 100 neither 50,004 nor 49,996 is a square. To find its index, round log(x × √5) ⁄ log φ; for 144 that gives 12, and F(12) = 144.
Which Fibonacci numbers are even, and what divides what?
Every third one: F(3) = 2, F(6) = 8, F(9) = 34, F(12) = 144, with two odd terms between each pair. That is a case of a wider rule: F(m) divides F(n) whenever m divides n, and more generally the greatest common divisor of two Fibonacci numbers is the Fibonacci number at the greatest common divisor of their indices.
How are Lucas numbers connected to Fibonacci numbers?
Several exact identities tie them together. L(n) = F(n−1) + F(n+1), so L(20) = 4181 + 10946 = 15127. F(2n) = F(n) × L(n), so F(40) = 6765 × 15127 = 102,334,155. And L(n)² − 5F(n)² is always 4 or −4: for n = 20, 5 × 6765² + 4 equals 15127², which is why the perfect-square test for Fibonacci numbers works.
Why does the As a number line disagree with the exact value for large indices?
That line is the same term stored as a standard double, which holds every whole number only up to 2⁵³, about 9.007 × 10¹⁵. F(78) = 8,944,394,323,791,464 still fits; F(79) = 14,472,334,024,676,221 is odd and too large, so the nearest storable value is 14,472,334,024,676,220. Use the exact value whenever the final digits matter.
Can the sequence be extended to negative indices?
Yes. Running the rule backwards as F(n−2) = F(n) − F(n−1) gives F(−1) = 1, F(−2) = −1, F(−3) = 2, with the pattern F(−n) = (−1)ⁿ⁺¹ F(n). The calculator does not accept negative indices, but at index 0 its previous term shows that backward step: 1 for Fibonacci and −1 for Lucas.
Why stop at index 300?
F(300) is already a 63-digit number, and the ratio line has long since stopped spelling out its fraction: once a term passes 25 digits, which Fibonacci first does at index 122, it reports the ratio and its gap from φ without the two operands. Beyond 300 the exact value stops being something you can read or copy comfortably, and the calculator refuses rather than switching to a rounded figure.
Where do Fibonacci numbers turn up outside textbooks?
The number of ways to tile a 2 × n strip with dominoes is F(n+1). The shallow diagonals of Pascal's triangle add up to Fibonacci numbers. Consecutive Fibonacci numbers are the inputs that make Euclid's greatest-common-divisor algorithm take the most steps for their size. Spiral counts in sunflower heads and pine cones are often neighbouring terms, and because φ is close to 1.609, the kilometres in a mile, 5 miles is about 8 km and 8 miles about 13 km.

References& sources.

  1. [1]Wolfram MathWorld, 'Fibonacci Number' — the recurrence F_n = F_(n−1) + F_(n−2) with F₁ = F₂ = 1 and F₀ = 0 by convention (eq. 1); Binet's formula (eq. 6); the summation identity Σ_(k=1)^(n) F_k = F_(n+2) − 1 (eq. 22); and lim F_n/F_(n−1) = φ (eq. 78, first proved by Robert Simson in 1753). Retrieved 2026-07-29; open access.
  2. [2]Wolfram MathWorld, 'Lucas Number' — L_n = L_(n−1) + L_(n−2) with L₁ = 1 and L₂ = 3 (which forces L₀ = 2), and the printed run 1, 3, 4, 7, 11, 18, 29, 47, 76, 123. Retrieved 2026-07-29; open access.
  3. [3]Encyclopedia of Mathematics (European Mathematical Society), 'Fibonacci numbers' — independent check: u₁ = u₂ = 1 with u_(n+1) = u_n + u_(n−1); the Binet closed form; lim u_(n+1)/u_n = φ; and the Lucas companion with v₀ = 2, v₁ = 1. Confirms F(20) = 6765 and the Lucas seeds used here. Retrieved 2026-07-29; open access.
  4. [4]NIST Digital Library of Mathematical Functions, §5.2(ii), equation 5.2.3 — the digit discipline used for irrational constants on Quanta's sequence pages; φ is quoted to the same standard. Retrieved 2026-07-29; open access.
  5. [5]OEIS Foundation, sequences A000045 (Fibonacci) and A000032 (Lucas) — the canonical index registrations, both with offset 0. Listed for the reader's reference only: oeis.org returned HTTP 403 to this session, so the 0-based offsets were confirmed against MathWorld and the Encyclopedia of Mathematics instead and nothing on this page depends on this entry alone.

How this page was produced

Published by
Quanta Calculator
Primary sources
5 cited below
Method
F(n) = F(n−1) + F(n−2), F(0) = 0, F(1) = 1
Published
Last verified

Built with AI assistance and verified by automated tests against the cited sources — every worked example on this page is computed by the same code that runs the calculator. How we build and check calculators.

In this category

Embed

Quanta Pro

Paid features are coming later.

  • All 1560 calculators remain free
  • No billing is enabled
Coming soon