Given an integer N, the task is to check whether N divides the sum of the factorials of its digits.
Input: N = 19
1! + 9! = 1 + 362880 = 362881 which is divisible by 19.
Input: N = 20
0! + 2! = 1 + 4 = 5 which is not divisible by 20.
Approach: First, store the factorials of all the digits from 0 to 9 in an array. And, for the given number N check if it divides the sum of the factorials of its digits.
Below is the implementation of the above approach:
- Check if the sum of digits of a number N divides it
- Count of prime digits of a Number which divides the number
- Find last two digits of sum of N factorials
- Check whether product of digits at even places is divisible by sum of digits at odd place of a number
- Check if the sum of digits of number is divisible by all of its digits
- Check if a M-th fibonacci number divides N-th fibonacci number
- Check if the Xor of the frequency of all digits of a number N is zero or not
- Check if all digits of a number divide it
- Check if the frequency of all the digits in a number is same
- Check if a number has digits in the given Order
- Check if two numbers have same number of digits
- Check if a number with even number of digits is palindrome or not
- Program to check if a number is divisible by any of its digits
- Program to check if a number is divisible by sum of its digits
- Check if a number is magic (Recursive sum of digits is 1)
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.