Fibonacci Calculator
F(100) = 354,224,848,179,261,915,075. It has 21 digits and ends in 5. The Fibonacci sequence starts 0, 1, 1, 2, 3, 5, 8, 13, … and every term is the sum of the two before it, F(n) = F(n − 1) + F(n − 2), with F(0) = 0. This calculator gives F(n) exactly for any whole n up to 10,000 (F(10,000) has 2,090 digits) by fast doubling, and a negative index by the negafibonacci rule. It also lists the first N terms, tests whether a number is a Fibonacci number with 5n² ± 4 and finds its index, adds the first n terms (F(n + 2) − 1), compares F(n + 1) ÷ F(n) with the golden ratio φ = 1.618033988749895, and shows the digit count and last digits, which repeat every 60 terms.
Updated Runs in your browser: nothing you enter is uploadedHow this tool works
F(100) = F(99) + F(98)
F(100) = 354,224,848,179,261,915,075
21 digits, last digit 5
- Number of digits
- 21
- Scientific notation
- 3.54224848179 × 10²⁰
- First 20 digits
- 35422484817926191507…
- Last 20 digits
- …54224848179261915075
- Last digit
- 5
- Even or odd
- Odd (the index is not a multiple of 3)
All digits
The working
- Every term is the sum of the two before it: F(100) = F(99) + F(98) = 218,922,995,834,555,169,026 + 135,301,852,344,706,746,049 = 354,224,848,179,261,915,075.
- Instead of 100 additions, fast doubling reads the 7 bits of 100 (1100100 in binary) and builds the pair (F(k), F(k + 1)) with F(2k) = F(k)(2F(k + 1) − F(k)) and F(2k + 1) = F(k)² + F(k + 1)²: 7 doubling steps.
- The value has 21 digits; the estimate ⌊100 × log₁₀ φ − log₁₀ √5⌋ + 1 gives 21.
- The last digits repeat every 60 terms (the Pisano period π(10) = 60), so the last digit of F(100) is the last digit of F(100 mod 60) = F(40) = 102,334,155: 5.
- F(n) is even exactly when n is a multiple of 3, because the parity pattern odd, odd, even repeats: 100 is not a multiple of 3, so the value is odd.
Fibonacci numbers F(0) to F(30)
| n | F(n) | Digits | Last digit | F(n + 1) ÷ F(n) |
|---|---|---|---|---|
| 0 | 0 | 1 | 0 | Undefined: F(0) = 0 |
| 1 | 1 | 1 | 1 | 1.000000000000000 |
| 2 | 1 | 1 | 1 | 2.000000000000000 |
| 3 | 2 | 1 | 2 | 1.500000000000000 |
| 4 | 3 | 1 | 3 | 1.666666666666667 |
| 5 | 5 | 1 | 5 | 1.600000000000000 |
| 6 | 8 | 1 | 8 | 1.625000000000000 |
| 7 | 13 | 2 | 3 | 1.615384615384615 |
| 8 | 21 | 2 | 1 | 1.619047619047619 |
| 9 | 34 | 2 | 4 | 1.617647058823529 |
| 10 | 55 | 2 | 5 | 1.618181818181818 |
| 11 | 89 | 2 | 9 | 1.617977528089888 |
| 12 | 144 | 3 | 4 | 1.618055555555556 |
| 13 | 233 | 3 | 3 | 1.618025751072961 |
| 14 | 377 | 3 | 7 | 1.618037135278515 |
| 15 | 610 | 3 | 0 | 1.618032786885246 |
| 16 | 987 | 3 | 7 | 1.618034447821682 |
| 17 | 1,597 | 4 | 7 | 1.618033813400125 |
| 18 | 2,584 | 4 | 4 | 1.618034055727554 |
| 19 | 4,181 | 4 | 1 | 1.618033963166707 |
| 20 | 6,765 | 4 | 5 | 1.618033998521803 |
| 21 | 10,946 | 5 | 6 | 1.618033985017358 |
| 22 | 17,711 | 5 | 1 | 1.618033990175597 |
| 23 | 28,657 | 5 | 7 | 1.618033988205325 |
| 24 | 46,368 | 5 | 8 | 1.618033988957902 |
| 25 | 75,025 | 5 | 5 | 1.618033988670443 |
| 26 | 121,393 | 6 | 3 | 1.618033988780243 |
| 27 | 196,418 | 6 | 8 | 1.618033988738303 |
| 28 | 317,811 | 6 | 1 | 1.618033988754323 |
| 29 | 514,229 | 6 | 9 | 1.618033988748204 |
| 30 | 832,040 | 6 | 0 | 1.618033988750541 |
Digit counts of F(n) for selected n
| n | Digits of F(n) | Estimate by formula | F(n) in scientific notation | Last 4 digits |
|---|---|---|---|---|
| 20 | 4 | 4 | 6.765 × 10³ | 6765 |
| 50 | 11 | 11 | 1.25863 × 10¹⁰ | 9025 |
| 100 | 21 | 21 | 3.54225 × 10²⁰ | 5075 |
| 200 | 42 | 42 | 2.80571 × 10⁴¹ | 9525 |
| 500 | 105 | 105 | 1.39423 × 10¹⁰⁴ | 4125 |
| 1,000 | 209 | 209 | 4.34666 × 10²⁰⁸ | 8875 |
| 2,000 | 418 | 418 | 4.2247 × 10⁴¹⁷ | 7125 |
| 5,000 | 1,045 | 1,045 | 3.87897 × 10¹⁰⁴⁴ | 3125 |
| 10,000 | 2,090 | 2,090 | 3.36448 × 10²⁰⁸⁹ | 6875 |
Is it a Fibonacci number? The test 5m² ± 4
| m | 5m² + 4 | 5m² − 4 | Fibonacci number? |
|---|---|---|---|
| 1 | 9 = 3² | 1 = 1² | Yes: F(1) = F(2) |
| 4 | 84 (not a square) | 76 (not a square) | No: between F(4) and F(5) |
| 8 | 324 = 18² | 316 (not a square) | Yes: F(6) |
| 13 | 849 (not a square) | 841 = 29² | Yes: F(7) |
| 20 | 2,004 (not a square) | 1,996 (not a square) | No: between F(7) and F(8) |
| 21 | 2,209 = 47² | 2,201 (not a square) | Yes: F(8) |
| 50 | 12,504 (not a square) | 12,496 (not a square) | No: between F(9) and F(10) |
| 55 | 15,129 = 123² | 15,121 (not a square) | Yes: F(10) |
| 100 | 50,004 (not a square) | 49,996 (not a square) | No: between F(11) and F(12) |
| 144 | 103,684 = 322² | 103,676 (not a square) | Yes: F(12) |
| 1,000 | 5,000,004 (not a square) | 4,999,996 (not a square) | No: between F(16) and F(17) |
| 6,765 | 228,826,129 = 15,127² | 228,826,121 (not a square) | Yes: F(20) |
| 832,040 | 3,461,452,808,004 = 1,860,498² | 3,461,452,807,996 (not a square) | Yes: F(30) |
Sum of the first n Fibonacci numbers
| n | Terms added | Sum | F(n + 2) |
|---|---|---|---|
| 1 | 1 | 1 | 2 |
| 2 | 1 + 1 | 2 | 3 |
| 3 | 1 + 1 + 2 | 4 | 5 |
| 4 | 1 + 1 + 2 + 3 | 7 | 8 |
| 5 | 1 + 1 + 2 + 3 + 5 | 12 | 13 |
| 6 | 1 + 1 + 2 + 3 + 5 + 8 | 20 | 21 |
| 7 | 1 + 1 + 2 + 3 + 5 + 8 + 13 | 33 | 34 |
| 8 | 1 + 1 + 2 + 3 + 5 + 8 + 13 + 21 | 54 | 55 |
| 9 | 1 + 1 + 2 + 3 + 5 + 8 + 13 + 21 + 34 | 88 | 89 |
| 10 | 1 + 1 + 2 + 3 + 5 + 8 + 13 + 21 + 34 + 55 | 143 | 144 |
| 15 | F(1) + F(2) + … + F(15) | 1,596 | 1,597 |
| 20 | F(1) + F(2) + … + F(20) | 17,710 | 17,711 |
| 30 | F(1) + F(2) + … + F(30) | 2,178,308 | 2,178,309 |
| 50 | F(1) + F(2) + … + F(50) | 32,951,280,098 | 32,951,280,099 |
| 100 | F(1) + F(2) + … + F(100) | 927,372,692,193,078,999,175 | 927,372,692,193,078,999,176 |
Golden-ratio convergence of F(n + 1) ÷ F(n)
| n | F(n + 1) ÷ F(n), 15 decimals | Side of φ | Distance from φ |
|---|---|---|---|
| 1 | 1.000000000000000 | Below | 6.18 × 10⁻¹ |
| 2 | 2.000000000000000 | Above | 3.82 × 10⁻¹ |
| 3 | 1.500000000000000 | Below | 1.18 × 10⁻¹ |
| 4 | 1.666666666666667 | Above | 4.86 × 10⁻² |
| 5 | 1.600000000000000 | Below | 1.80 × 10⁻² |
| 6 | 1.625000000000000 | Above | 6.97 × 10⁻³ |
| 8 | 1.619047619047619 | Above | 1.01 × 10⁻³ |
| 10 | 1.618181818181818 | Above | 1.48 × 10⁻⁴ |
| 15 | 1.618032786885246 | Below | 1.20 × 10⁻⁶ |
| 20 | 1.618033998521803 | Above | 9.77 × 10⁻⁹ |
| 25 | 1.618033988670443 | Below | 7.95 × 10⁻¹¹ |
| 30 | 1.618033988750541 | Above | 6.46 × 10⁻¹³ |
| 35 | 1.618033988749890 | Below | 5.25 × 10⁻¹⁵ |
| 37 | 1.618033988749894 | Below | 7.66 × 10⁻¹⁶ |
| 38 | 1.618033988749895 | Above | 2.93 × 10⁻¹⁶ |
| 40 | 1.618033988749895 | Above | 4.27 × 10⁻¹⁷ |
Pisano periods: how F(n) mod m repeats
| m | Period π(m) | First remainders F(0), F(1), F(2), … |
|---|---|---|
| 2 | 3 | 0, 1, 1 |
| 3 | 8 | 0, 1, 1, 2, 0, 2, 2, 1 |
| 4 | 6 | 0, 1, 1, 2, 3, 1 |
| 5 | 20 | 0, 1, 1, 2, 3, 0, 3, 3, 1, 4, 0, 4, … |
| 6 | 24 | 0, 1, 1, 2, 3, 5, 2, 1, 3, 4, 1, 5, … |
| 7 | 16 | 0, 1, 1, 2, 3, 5, 1, 6, 0, 6, 6, 5, … |
| 8 | 12 | 0, 1, 1, 2, 3, 5, 0, 5, 5, 2, 7, 1 |
| 9 | 24 | 0, 1, 1, 2, 3, 5, 8, 4, 3, 7, 1, 8, … |
| 10 | 60 | 0, 1, 1, 2, 3, 5, 8, 3, 1, 4, 5, 9, … |
| 11 | 10 | 0, 1, 1, 2, 3, 5, 8, 2, 10, 1 |
| 12 | 24 | 0, 1, 1, 2, 3, 5, 8, 1, 9, 10, 7, 5, … |
| 20 | 60 | 0, 1, 1, 2, 3, 5, 8, 13, 1, 14, 15, 9, … |
| 50 | 300 | 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 5, 39, … |
| 100 | 300 | 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, … |
| 1000 | 1,500 | 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, … |
Negafibonacci numbers F(−n) next to F(n)
| n | F(n) | F(−n) | Sign of F(−n) |
|---|---|---|---|
| 0 | 0 | 0 | Zero |
| 1 | 1 | 1 | Positive (n is odd) |
| 2 | 1 | −1 | Negative (n is even) |
| 3 | 2 | 2 | Positive (n is odd) |
| 4 | 3 | −3 | Negative (n is even) |
| 5 | 5 | 5 | Positive (n is odd) |
| 6 | 8 | −8 | Negative (n is even) |
| 7 | 13 | 13 | Positive (n is odd) |
| 8 | 21 | −21 | Negative (n is even) |
| 9 | 34 | 34 | Positive (n is odd) |
| 10 | 55 | −55 | Negative (n is even) |
| 11 | 89 | 89 | Positive (n is odd) |
| 12 | 144 | −144 | Negative (n is even) |
Worked examples
| Question | Answer | How it is found |
|---|---|---|
| What is F(10)? | F(10) = 55 | Add from 0 and 1: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55. |
| What is F(50)? | F(50) = 12,586,269,025 | Fast doubling over the 6 bits of 50 (110010 in binary), or 49 additions. |
| How many digits does F(1,000) have? | 209 digits | Exact count; the estimate ⌊1,000 × log₁₀ φ − log₁₀ √5⌋ + 1 gives 209. |
| Is 6,765 a Fibonacci number? | 6,765 is a Fibonacci number: F(20) | 5m² + 4 = 228,826,129 = 15,127². |
| Which index has the value 832,040? | n = 30 | 5m² + 4 = 3,461,452,808,004 = 1,860,498²; a binary search over F(2) … F(10,000) finds the index. |
| What do the first 20 terms add up to? | 17,710 | F(22) − 1 = 17,711 − 1. |
| What is the last digit of F(1,234)? | 7 | 1,234 mod 60 = 34, and F(34) = 5,702,887 ends in 7. |
| How close is F(21) ÷ F(20) to the golden ratio? | 1.618033998521803 against φ = 1.618033988749895 | Above φ by about 9.77 × 10⁻⁹. |
How to find a Fibonacci number
- Start the sequence at 0 and 1. F(0) = 0 and F(1) = 1. Every later term is the sum of the two before it, so the sequence runs 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, … For F(100) that rule gives F(99) + F(98).
- Jump straight to F(n) by fast doubling. To skip the additions, read the bits of n and double: F(2k) = F(k)(2F(k + 1) − F(k)) and F(2k + 1) = F(k)² + F(k + 1)². F(100) takes 7 doubling steps and F(10,000) takes 14.
- Test a number and find its index. Compute 5m² + 4 and 5m² − 4: if either is a perfect square, m is a Fibonacci number. For 6,765: 5m² + 4 = 228,826,129 = 15,127². Then search the sequence for the index: n = 20.
- Add the first n terms with one lookup. The first n terms add up to F(n + 2) − 1, so the first 20 add up to F(22) − 1 = 17,711 − 1 = 17,710.
- Compare neighbouring terms with the golden ratio. Divide F(n + 1) by F(n): F(21) ÷ F(20) = 1.618033998521803 against φ = 1.618033988749895. The ratio equals φ to 15 decimals from n = 38 on.
Frequently asked questions
- What is the Fibonacci sequence?
- It is the sequence 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, … in which every term is the sum of the two before it: F(n) = F(n − 1) + F(n − 2), starting from F(0) = 0 and F(1) = 1. The first 12 terms are 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89. The terms grow by a factor close to the golden ratio φ ≈ 1.618034 at every step, so F(10,000) already has 2,090 digits.
- What are F(10), F(20), F(50) and F(100)?
- F(10) = 55, F(20) = 6,765, F(30) = 832,040, F(50) = 12,586,269,025 and F(100) = 354,224,848,179,261,915,075 (21 digits). F(1,000) is a 209-digit number that starts 4346655768… and ends …6849228875.
- Does the Fibonacci sequence start at 0 or at 1?
- The standard convention, used by this calculator and by the OEIS sequence A000045, starts at F(0) = 0, F(1) = 1, so F(2) = 1 and the first terms are 0, 1, 1, 2, 3, 5. Many textbooks start at F(1) = 1, F(2) = 1 and have no F(0); the numbers are the same, only the leading 0 differs. Check which convention a worksheet uses before reading off an index: with the standard one, F(10) = 55 is the eleventh number in the list, and the list-mode terms are F(0) to F(N − 1).
- Is there a Fibonacci number for a negative index?
- Yes. Run the rule backwards, F(n − 2) = F(n) − F(n − 1), and the sequence continues to the left as 0, 1, −1, 2, −3, 5, −8, … These are the negafibonacci numbers, F(−n) = (−1)^(n + 1) × F(n): the same values with a minus sign when n is even. For example F(−10) = −55 and F(−11) = 89. The F(n) mode accepts any index from −10,000 to 10,000.
- How do I check whether a number is a Fibonacci number?
- A whole number m is a Fibonacci number exactly when 5m² + 4 or 5m² − 4 is a perfect square. For m = 144: 5 × 144² + 4 = 103,684 = 322², so 144 is F(12). For m = 100 neither 5m² + 4 = 50,004 nor 5m² − 4 = 49,996 is a square, so 100 is not a Fibonacci number; it lies between F(11) = 89 and F(12) = 144. The calculator takes exact integer square roots, so it tests numbers up to F(10,000), which has 2,090 digits.
- How do I find the index of a Fibonacci number?
- The index n is the position with F(n) = m. The calculator searches F(2) … F(10,000) by halving the range, about 14 look-ups, so 832,040 gives n = 30 and 354,224,848,179,261,915,075 gives n = 100. The value 1 is the one exception with two indices, F(1) = F(2) = 1; the value 0 is F(0). A number that is not a Fibonacci number has no index, and the calculator names the Fibonacci numbers just below and above it instead.
- What is the sum of the first n Fibonacci numbers?
- F(1) + F(2) + … + F(n) = F(n + 2) − 1. Because F(k) = F(k + 2) − F(k + 1), the terms cancel in pairs (a telescoping sum) and only F(n + 2) − F(2) = F(n + 2) − 1 is left. The first 10 terms add up to 143 = F(12) − 1, the first 20 to 17,710, and the first 10,000 to a number with 2,090 digits. Starting the sum at F(0) = 0 changes nothing.
- Why does F(n + 1) ÷ F(n) approach the golden ratio?
- Because F(n + 1) − φ × F(n) = ψⁿ, where φ = (1 + √5) ÷ 2 = 1.618033988749895 and ψ = (1 − √5) ÷ 2 = −0.618033988749895 has absolute value below 1, so ψⁿ shrinks to nothing. The ratio therefore alternates around φ, below it for odd n (1.600000000000000 at n = 5) and above for even n (1.625000000000000 at n = 6), and each step brings it closer by a factor of about φ² = 2.618. At 15 decimals it equals φ from n = 38 on.
- How many digits does F(n) have?
- F(n) is the nearest integer to φⁿ ÷ √5, so its digit count is ⌊n × log₁₀ φ − log₁₀ √5⌋ + 1 for n ≥ 2: about 0.209 digits per step (log₁₀ φ). The formula agrees with the exact count for every n from 2 to 10,000. F(100) has 21 digits, F(1,000) has 209 and F(10,000) has 2,090. The calculator counts the digits of the exact value and shows the formula next to it.
- What are the last digits of Fibonacci numbers?
- They repeat. The last digit has period 60 (the Pisano period π(10)), the last two digits have period 300 and the last three digits 1,500. So the last digit of F(n) is the last digit of F(n mod 60): F(100) ends in 5 because 100 mod 60 = 40 and F(40) = 102,334,155. The calculator finds each period by stepping the pair of remainders from (0, 1) until it returns, so nothing is looked up from a list.
- Why not use Binet’s formula with decimals?
- Binet’s formula F(n) = (φⁿ − ψⁿ) ÷ √5 is exact on paper, but a standard double-precision number keeps about 15 to 16 significant digits. F(78) is the last Fibonacci number below 2⁵³, the limit up to which a double stores every whole number exactly, so past it a decimal calculation starts to lose digits. For whole-number types, F(92) is the largest that fits a signed 64-bit integer and F(93) the largest for an unsigned one. This calculator uses whole-number arithmetic (BigInt) and fast doubling, which reaches F(10,000) in 14 doubling steps instead of 10,000 additions.
- Which Fibonacci numbers are even, and which are perfect squares?
- F(n) is even exactly when n is a multiple of 3 (the parity pattern odd, odd, even repeats): F(0) = 0, F(3) = 2, F(6) = 8, F(9) = 34, F(12) = 144, F(15) = 610, … Among F(0) to F(1,000) the perfect squares are only F(0) = 0, F(1) = 1, F(2) = 1, F(12) = 144; no other square turns up in that range with the calculator’s exact square-root test.
- Which identities link Fibonacci numbers?
- Cassini’s identity says F(n + 1) × F(n − 1) − F(n)² = (−1)ⁿ: for n = 10 it gives F(11) × F(9) − F(10)² = 89 × 34 − 55² = 1. The greatest common divisor of two Fibonacci numbers is the Fibonacci number at the gcd of the indices: gcd(F(12), F(18)) = gcd(144, 2584) = 8 = F(6). F(m) divides F(n) whenever m divides n: F(12) = 144 is divisible by F(3) = 2, F(4) = 3, F(6) = 8.
- Why does the calculator stop at n = 10,000?
- F(10,000) already has 2,090 digits, and larger values make the page slow to read and copy while adding nothing new: the digit count follows the same formula and the last digits follow the Pisano periods. The list mode stops at 500 terms for the same reason, and the test mode accepts numbers up to F(10,000).
How it works
Convention: F(0) = 0, F(1) = 1 and F(n) = F(n − 1) + F(n − 2), as in OEIS A000045. Negative indices use F(−n) = (−1)^(n + 1) × F(n), which is the same rule run backwards. Input: whole numbers only, typed with digits; a sign, thousands commas or spaces and a zero fraction ("5.0") are accepted, other decimals, fractions and larger values are rejected with a message. The ranges are −10,000 to 10,000 for F(n), 1 to 500 terms for the list, 0 to 10,000 for the sum, the digits and the ratio (the ratio from 1), and 0 up to F(10,000) for the test. Exact arithmetic: F(n) is computed in BigInt by fast doubling, F(2k) = F(k)(2F(k + 1) − F(k)) and F(2k + 1) = F(k)² + F(k + 1)², reading the bits of n from the top; the list uses plain addition. The sum F(1) + … + F(n) is F(n + 2) − 1. Test and index: m is a Fibonacci number exactly when 5m² + 4 or 5m² − 4 is a perfect square, decided with an exact integer square root (Newton’s method); the index comes from a binary search over F(2) … F(10,000), since F is strictly increasing from n = 2. Golden ratio: φ = (1 + √5) ÷ 2 is computed from the integer square root of 5 × 10^36 and F(n + 1) ÷ F(n) by integer division, both rounded half up at 15 decimals. The distance from φ, φ⁻ⁿ ÷ F(n), is the one floating-point figure besides the digit-count estimate; it is shown with three significant digits. Digits: the digit count, the first and last 20 digits and the scientific notation (12 significant digits, rounded half up) are read from the decimal string of the exact value. The last digits use the Pisano period, found by stepping the pair of remainders until it returns to (0, 1). The full number is written out only on request and is never part of the page HTML.
Sources
Guides
- Prime Numbers and Fibonacci Numbers ExplainedWhat primes are, how trial division and the sieve of Eratosthenes find them, how Fibonacci numbers approach the golden ratio, and which ones are prime.
More free tools
- Scientific CalculatorFree online scientific calculator with live results: trig in DEG, RAD or GRAD, logs, powers, factorial, nPr, nCr, memory and history.
- Prime Number CheckerTest whether a number up to 3.3 × 10^24 is prime, find the next and previous prime, list primes in a range, count primes up to N, and see twin primes.
- Arithmetic and Geometric Sequence CalculatorFind the nth term, the sum of the first n terms, the formulas and the infinite sum of an arithmetic, geometric or Fibonacci-like sequence, step by step.
- Modulo CalculatorFind a mod n for any integers up to 200 digits, with floor and truncated remainders side by side, plus congruence, aᵇ mod n and the modular inverse.
- Complex Number CalculatorAdd, subtract, multiply and divide complex numbers exactly, then find the modulus, argument, polar form, powers, square roots and roots of unity.
- System of Equations CalculatorSolve 2 or 3 linear equations exactly: row-reduction steps, determinant, Cramer’s rule and a graph. Finds one, no or infinitely many solutions.
More: Algebra and number theoryAll math & numbersAll toolsHome & DIY calculators