Functions
Function-44
Function-45
Function-46
~/algor $ cat problems/funksiya-fibonachchimi
Is it a Fibonacci number
Easy
1000 ms
128 MB
32%
Write a function IsFibonacci(x) that returns true if the non-negative integer $x$ is a Fibonacci number and false otherwise. The Fibonacci numbers start with $0$ and $1$, and each next one is the sum of the previous two: $0, 1, 1, 2, 3, 5, 8, 13, \ldots$
Example 1: IsFibonacci(13) → true
Example 2: IsFibonacci(4) → false
Write only the function body.
Input
One line with a non-negative integer $x$ — the argument of the function.
Output
The value returned by the function: true or false.
Note
$0 \le x \le 10^{15}$
Examples
Input #1
13
Output #1
true
Input #2
4
Output #2
false