What is Fibonacci Number?
The number that are present in Fibonacci Series is known as Fibonacci number. The Fibonacci numbers are the following integer sequence: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, …
There are three methods to check the given number is Fibonacci Number or not, these are:
Table of Content
- Using Mathematical Formula
- Using while Loop
Check if a Given Number is Fibonacci Number in PHP
Given a number N, the task is to check whether the given number is a Fibonacci number or not.
Examples:
Input: 21
Output: Fibonacci Number
Input: 35
Output: Not a Fibonacci Number