Guide
Finding Fibonacci numbers exactly, summing them and testing whether a number belongs
In the Fibonacci sequence each number is the sum of the two before it: 0, 1, 1, 2, 3, 5, 8, 13 and on. It shows up in spirals of shells and flowers, in puzzles, in sorting algorithms and in interview questions. This page returns exact terms far beyond what a spreadsheet can show, adds up the terms for you, and checks whether a number of your own belongs to the sequence.
How it works
Adding terms one at a time would take 20,000 steps to reach F(20,000), but the page uses fast doubling instead, which relies on the identities F(2k) = F(k) × (2 × F(k+1) − F(k)) and F(2k+1) = F(k) squared plus F(k+1) squared. These let the position be halved at every step, so only about fifteen steps are needed. All the arithmetic is done with big integers, so every digit is exact. F(20,000) has 4,180 digits.
Finding the nth term
Choose to find the nth Fibonacci number, enter n from 0 to 20,000, and the page shows the term, the number of digits, the sum of all terms from F(0) up to F(n), the ratio of the term to the one before it and, for small n, the first twenty terms. The sum uses the identity that adding F(0) to F(n) always gives F(n + 2) minus 1, so no long addition is needed. A term with more than 40 digits is shown with all its digits in a text box that you can copy or download.
Checking a number
Choose the check option and enter any positive whole number. A number N is Fibonacci exactly when 5 × N squared plus 4 or 5 × N squared minus 4 is a perfect square. The tool tests this with exact integer square roots, and when the answer is yes it tells you the position, such as that 144 is F(12). When the answer is no it prints the two expressions it tested, 5m² + 4 and 5m² − 4, and says that neither is a perfect square.
Edge cases
n must be a whole number from 0 to 20,000. F(0) is 0 and F(1) and F(2) are both 1, so the number 1 is Fibonacci at two positions. The ratio of a term to the previous term is not defined for n below 2 and is left out. Numbers to check can be as large as the page accepts, and the square test stays exact because it uses integers, not floating-point arithmetic.
A worked example
F(50) is 12,586,269,025, a number with 11 digits. The sum of F(0) through F(50) is 32,951,280,098, which is F(52) minus 1. The ratio F(50) divided by F(49) is 1.61803398875, matching the golden ratio 1.6180339887 to every shown digit. F(100) is 354,224,848,179,261,915,075, with 21 digits, and its sum is 927,372,692,193,078,999,175. For the check mode, 144 is a Fibonacci number, F(12), while 145 is not, because 5 × 145² + 4 and 5 × 145² − 4 are not perfect squares.
Limits
The page computes the standard sequence only. Variants such as Lucas numbers, negative indices and generalised recurrences are not offered. The limit of 20,000 is there to keep the page fast and the result readable, since the digits roughly grow by 0.21 per step. The membership test works for numbers you type, not for a list pasted in bulk.
Related tools
- Golden Ratio Calculator uses the limit of the ratio of consecutive terms to split lengths and layouts.
- Sequence Calculator handles sequences defined by a fixed difference or ratio rather than a recurrence.
- Factorial Calculator gives another exact big-integer sequence to compare growth rates.
- Prime Factorization Calculator can factor a Fibonacci number up to the size limit of that page.
Checked against the current version of the Fibonacci Calculator on .

