Randomly

Is it a Fibonacci number?

Type a whole number to see whether it's a Fibonacci number, and which one. Exact for very large inputs.

Input

Fibonacci membership

—

Type a whole number to check whether it's in the Fibonacci sequence.

A non-negative integer n is a Fibonacci number exactly when 5n² + 4 or 5n² − 4 is a perfect square. The sequence starts F0 = 0, F1 = 1, then each term is the sum of the previous two: 0, 1, 1, 2, 3, 5, 8, 13, 21…

Test
5n² ± 4
Reports
Index

Related tools

Guides

This Fibonacci number checker tells you whether a non-negative whole number is in the Fibonacci sequence and, if it is, its index. Type 89 and you'll get F11. It uses the 5n² ± 4 perfect-square test on BigInt values, so a 50-digit number is checked as exactly as a 2-digit one. Commas are ignored, so 6,765 works too.

How to check if a number is a Fibonacci number

  1. Type or paste the number. Digits only, though commas are fine.
  2. The answer updates as you type: Fibonacci or not.
  3. If it is one, the result shows its index, like F11 for 89.
  4. Click the result, or Copy result, to copy it.

The 5n² ± 4 perfect-square test

A non-negative integer n is a Fibonacci number exactly when 5n² + 4 or 5n² - 4 is a perfect square. Take 8: 5 × 64 - 4 = 316, which isn't a square, but 5 × 64 + 4 = 324 = 18². So 8 is in the sequence. The tool finds square roots with integer arithmetic on BigInt, because a floating-point square root of a 100-digit number is too rough to trust. For numbers below 10^15 it gets the index by walking the sequence; above that it calculates the index from a logarithm, since F(k) is close to φ^k ÷ √5.

Frequently asked questions

How can I tell if a number is a Fibonacci number?

Check whether 5n² + 4 or 5n² - 4 is a perfect square. If either one is, n is a Fibonacci number. For 13: 5 × 169 - 4 = 841 = 29².

What is the Fibonacci index?

The position in the sequence, counting from F0 = 0. 13 is F7: 0, 1, 1, 2, 3, 5, 8, 13.

Is 0 a Fibonacci number?

Yes, it's F0. And 1 appears twice, as F1 and F2. The tool reports the first, F1.

What is the largest Fibonacci number this tool can check?

The code sets no limit. Very long inputs, thousands of digits, just take a little longer.

Built and maintained by Bipul Kumar. Found a wrong number or a broken result? Tell me and I'll fix it.