Author: Sahil Rajput
Tester: Sahil Rajput
Editorialist: Sahil Rajput
ProblemGiven a number N, task is to check whether that number exist in fibonacci series or not.
ExplanationA simple way is to generate fibonacci number until the generated number is greater than or equal to ’n’ but this approach will give you 70 points. For 100 points, you have to use the [property of fibonacci number] that can also be used to check if a given number is Fibonacci or not.
A number is Fibonacci if and only if one or both of (5n^2 + 4) or (5n^2 – 4) is a perfect square.