A strong number is a special type of number whose sum of the factorial of digits is equal to the original number. In other words, if we take the digits of a number, find the factorial of each digit, and add them together, the resulting sum is equal to the original number. For example, 145 is a strong number because 1! + 4! + 5! = 1 + 24 + 120 = 145.
To check if a number is a strong number, we can follow these steps:
- Take each digit starting from the unit place and find its factorial.
- Add the factorials of each digit.
- Compare the result with the original number. If they are equal, then the number is a strong number; otherwise, it is not.
We can also print all strong numbers less than or equal to a given number N by iterating from 1 to N and checking if each number is a strong number or not.