Fibonacci numbers with every digit intact
The rule fits on one line. Start with 0 and 1, then add the last two terms to get the next. The first 25 terms below cover what most homework asks for. Past F(70) the arithmetic gets harder for software than for people, and the section after the list explains why.
- 00
- 11
- 21
- 32
- 43
- 55
- 68
- 713
- 821
- 934
- 1055
- 1189
- 12144
- 13233
- 14377
- 15610
- 16987
- 171,597
- 182,584
- 194,181
- 206,765
- 2110,946
- 2217,711
- 2328,657
- 2446,368
Small grey numbers are the index n. F(12) = 144 is the only Fibonacci number above 1 equal to a perfect square.
Why many Fibonacci calculators go wrong after F(70)
Most web calculators, spreadsheets, and quick scripts store numbers as 64-bit floating point values. Those hold about 15 to 16 significant digits. Fibonacci numbers gain a digit roughly every 4.8 terms, so the trouble starts early. We ran each common method against exact whole-number results to find the first wrong answer.
| Method | Last exact term | First failure |
|---|---|---|
Binet formula, round(φn / √5) in floating point | F(70) | F(71) comes out as 308061521170130, one too high |
Loop with a, b = b, a + b on JavaScript numbers | F(78) = 8944394323791464 | F(79) passes 253 and the last digits drift |
Excel or Google Sheets, =A1+A2 filled down | F(73), 15 digits | F(74) has 16 digits and the display pads with zeros |
| Floating point, any method | none past F(1476) | F(1477) overflows to Infinity |
| BigInt fast doubling, used on this page | F(100000), 20,899 digits | None inside the input range |
The old version of this page used the floating point loop, so F(79) and every term after it carried wrong digits. The rewrite moved everything to JavaScript BigInt. Paste F(100) from here into any checker and every one of its 21 digits matches.
How F(100000) comes back in a few milliseconds
Adding terms one at a time takes n steps. Fast doubling takes about log2(n) steps, around 17 for n = 100,000. Two identities do the work:
- F(2k) = F(k) × (2F(k+1) − F(k))
- F(2k+1) = F(k)2 + F(k+1)2
Read n in binary from the top bit down. Each bit doubles k, and a 1 bit adds one more step. Python integers have no size limit, so the same idea runs there without a library:
def fib(n):
if n == 0:
return (0, 1)
a, b = fib(n // 2)
c = a * (2 * b - a)
d = a * a + b * b
return (d, c + d) if n % 2 else (c, d)
print(fib(100)[0]) # 354224848179261915075
On a recent laptop, the calculator above returns F(100000) in under 10 ms. Most of the wait you notice is the browser drawing 20,899 digits, which is why long results open folded.
Watching the ratio settle on the golden ratio
Divide any term by the one before and the result drifts toward φ = 1.6180339887... from alternate sides. 2/1 overshoots, 3/2 falls short, 5/3 overshoots again. The gap shrinks by a factor of about 2.6 per step, so each extra term buys roughly 0.4 correct decimal places.
| Ratio | Value | Distance from φ |
|---|---|---|
| F(6) / F(5) | 1.600000000000 | 1.8 × 10−2 |
| F(11) / F(10) | 1.618181818182 | 1.5 × 10−4 |
| F(16) / F(15) | 1.618032786885 | 1.2 × 10−6 |
| F(21) / F(20) | 1.618033998522 | 9.8 × 10−9 |
| F(31) / F(30) | 1.618033988751 | 6.5 × 10−13 |
Pick Lucas or a custom pair in the sequence tab and the ratio chart heads to the same line. Any two positive starting numbers converge on φ. The starting pair only changes how fast the early ratios settle.
The 5n2 ± 4 test for spotting Fibonacci numbers
A whole number n belongs to the sequence exactly when 5n2 + 4 or 5n2 − 4 is a perfect square. Try 21. Five times 441 is 2,205. Add 4 and you get 2,209, which is 472. So 21 is in. For 1,000 the two candidates are 5,000,004 and 4,999,996, and neither has a whole square root, so 1,000 is out.
The checker tab runs this test with exact square roots for numbers up to 30 digits and shows both values. Past 30 digits the squares get unwieldy to read, so the checker walks the sequence instead and reports the neighbours on either side. Both routes give the same answer.
Zeckendorf sums, and a miles to kilometres trick
Every positive whole number splits into Fibonacci numbers with no two neighbours in the sequence, and that split is unique. Take the largest Fibonacci number that fits, subtract, and repeat.
- 100 = 89 + 8 + 3
- 1,000 = 987 + 13
- 2,026 = 1,597 + 377 + 34 + 13 + 5
- 1,000,000 = 832,040 + 121,393 + 46,368 + 144 + 55
A mile is 1.609 km, close to φ. Shift each piece of a Zeckendorf sum one place up the sequence and you convert miles to kilometres in your head. 100 miles is 89 + 8 + 3, which shifts to 144 + 13 + 5 = 162 km. The true figure is 160.9. Shift down to go the other way. The checker prints the sum for any number you test, Fibonacci or not.
Index 0 or index 1, and negative positions
Off-by-one mismatches cause most disagreements between Fibonacci lists. This page follows the convention used by OEIS A000045 and most programming references: F(0) = 0, F(1) = 1, F(2) = 1. Some textbooks begin at F(1) = F(2) = 1 and never mention zero. The values agree, only the labels shift. Switch the First term menu to index 1 when your source starts there.
Run the rule backwards and the sequence extends to negative positions: F(−1) = 1, F(−2) = −1, F(−3) = 2, F(−4) = −3. The sizes repeat the positive side and the signs alternate. Type a negative n in the F(n) tab to see the sign rule applied.
Patterns to test with the calculator
- Every third term is even. F(3) = 2, F(6) = 8, F(9) = 34. The F(n) tab flags parity from n alone.
- Every fourth term divides by 3, every fifth by 5. F(4) = 3, F(8) = 21, F(5) = 5, F(10) = 55.
- Last digits repeat every 60 terms. This cycle is the Pisano period for 10. The last two digits repeat every 300 terms. The F(n) tab prints n mod 60, which pins down the last digit without the full number.
- Common factors stay inside the sequence. gcd(F(m), F(n)) = F(gcd(m, n)). gcd(F(12), F(18)) = gcd(144, 2,584) = 8 = F(6).
- Running totals land one short of a term. F(0) through F(10) add up to 143, which is F(12) − 1.
Sunflowers, shells, and trading charts
Sunflower heads, pine cones, and pineapples often show spiral counts of neighbouring Fibonacci numbers, such as 34 and 55, or 55 and 89. Botanists tie this to new seeds forming at a turn close to 137.5 degrees. The nautilus shell is a different case. Measured shells grow along a spiral, but not the golden one, so treat that popular claim with suspicion.
Traders draw Fibonacci retracement lines at 23.6, 38.2, and 61.8 percent. Those levels come from ratios of terms three, two, and one positions apart. This calculator gives you the sequence and the ratios. Price levels for a chart belong in charting software.
Where this calculator stops
- F(n) for |n| up to 100,000. F(1,000,000) has 208,988 digits. The math still runs quickly, but the result is too long to read on a page, so the input stops at 100,000.
- Sequences of 500 terms. F(499) already has 104 digits. Past that a table stops being readable. Use the F(n) tab for single large terms.
- The checker reads up to 5,000 digits. The largest Fibonacci number under that ceiling is F(23926). Negative numbers, decimals, and expressions such as 2^64 are rejected with a note.
- Squares and spiral draw the first 12 terms. Square 13 would be 233 units wide next to a 1 unit square, too small to see. The drawing only appears for the standard 0 and 1 start.
- No tribonacci or other k-step rules. The calculator adds the last two terms only. Sequences built from three or more previous terms need the Mathematical Sequence Generator.
All math runs in your browser tab. Nothing you type reaches a server. Copy link stores the mode and your inputs in the address bar, nothing else.