I know fibonacci series is fn = f(n-1)+f(n-2) but how to check if a no is part of Fibonacci series or not please tell the logic in detail example
Given a Number N check if it part of Fibonacci Series or Not?
hello @anantgovil123
A simple way is to generate Fibonacci numbers until the generated number is greater than or equal to ānā. Following is an interesting property about Fibonacci numbers 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
so just check for above condition .