Given a number N, the task is to check if the given number and all its digits are Fibonacci. If so, then the given number is a Full Fibonacci Number, else not.
Explanation: 13 and its digits 1 and 3 are all Fibonacci numbers
Explanation: 4 is not a Fibonacci number.
First check if all digits of N are Fibonacci or not. If so, similarly check if N is Fibonacci or not by the principle that a number is Fibonacci if and only if one or both of (5*N2 + 4) or (5*N2 – 4) is a perfect square.
Below code is the implementation of the above approach:
GeeksforGeeks has prepared a complete interview preparation course with premium videos, theory, practice problems, TA support and many more features. Please refer Placement 100 for details
- Check if sum of Fibonacci elements in an Array is a Fibonacci number or not
- Check if a M-th fibonacci number divides N-th fibonacci number
- Check if a number is Full Prime
- An efficient way to check whether n-th Fibonacci number is multiple of 10
- How to check if a given number is Fibonacci number?
- Check if the n-th term is odd or even in a Fibonacci like sequence
- Check whether Array represents a Fibonacci Series or not
- Check whether frequency of characters in a string makes Fibonacci Sequence
- Number of ways to represent a number as sum of k fibonacci numbers
- Finding number of digits in n'th Fibonacci number
- Nth Even Fibonacci Number
- Nth XOR Fibonacci number
- Find the next Non-Fibonacci number
- Fibonacci number in an array
- Find the next fibonacci number
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.