KiloAtlas
EN
EnglishBahasa IndonesiaTiếng Việt

Fibonacci Checker

Check whether an integer from 0 to 1,000,000 is a Fibonacci number. Result 1 means yes; 0 means no.

Fibonacci? (1=yes, 0=no)

1

Formula

n>0: n is Fibonacci iff 5n²+4 or 5n²−4 is a perfect square; 0 is included.

Fibonacci? (1=yes, 0=no) ≈ max(floor(1÷(abs(floor(sqrt(5×(55)^2+4))^2-(5×(55)^2+4))+1)),floor(1÷(abs(floor(sqrt(5×(55)^2-4))^2-(5×(55)^2-4))+1)))

How to use

  1. Enter a nonnegative integer n.
  2. Use at most 1000000.
  3. Read 1 for Fibonacci or 0 otherwise.

Examples

  • 55 gives 1 because 5×55²+4=123².

Frequently asked questions

What do 1 and 0 mean?

The result is a flag: 1 means membership and 0 means nonmembership.

Why limit the input?

The bound keeps the square test safely within exact integer arithmetic.

Is zero included?

Yes. This tool uses the sequence beginning 0, 1, 1, 2, 3.

Sources

Updated:

Related tools

Search conversion tools