Project Euler
Problem 34: Digit Factorials

145 is a curious number, as 1 ! + 4 ! + 5 ! = 1 + 24 + 120 = 145 .

Find the sum of all numbers which are equal to the sum of the factorial of their digits.

Note: As 1 ! = 1 and 2 ! = 2 are not sums they are not included.



𝔹𝕣𝕦𝕥𝕖 𝔽𝕠𝕣𝕔𝕖. I used the classic recursive factorial algorithm to find my factorials. I used another function to to sum the factorials of the digits and I looped from 145 (which I had determined was the lowest) up to 50,000.

I don't know the math behind why the highest number is the limit but this works. For now.

92,608