Curious Numbers

Learn to write the solution for finding curious numbers.

Challenge

Write a program to find all curious numbers, up to 10000, that are equal to the sum of the factorial of their digits.

For this problem, you have to write two functions:

1. factorial ( )

This function takes an integer as its argument, calculates its factorial, and returns it.

2. isCurious ( )

This function also takes an integer as its argument. It returns true if the integer is curious and false otherwise.

Example

145 is a curious number, because:

Get hands-on with 1400+ tech skills courses.