Given a number n, the task is to determine whether n can be a factorial of some number x
Input: N = 24 Output: Yes Explanation: 4! = 24 Input: N = 25 Output: No
Divide x by 2, divide by 3, and so on, until you cannot divide further. If you reach the number 1, then it’s factorial number else not.
Below is the implementation of the above approach:
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Factorial of a number in PL/SQL
- C Program for factorial of a number
- Sum of divisors of factorial of a number
- Program for factorial of a number
- First digit in factorial of a number
- Factorial of a large number
- Smallest number with at least n digits in factorial
- Find the last two digits of Factorial of a given Number
- Calculate MDAS Factorial of given number
- One line function for factorial of a number
- Java Program for factorial of a number
- Python Program for factorial of a number
- Smallest number S such that N is a factor of S factorial or S!
- Number of digits in N factorial to the power N
- Find sum of digits in factorial of a number
- Maximum number with same digit factorial product
- Find the first natural number whose factorial is divisible by x
- Smallest number with at least n trailing zeroes in factorial
- Find the length of factorial of a number in any given base
- Count trailing zeroes in factorial of a 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 email@example.com. 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.