# 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.
#
# Answer: 40730

def factSum():
    equalFacts = []
    for i in range(10, 2600000):
        fSum = 0
        for j in str(i):
            fSum += factorial(int(j))
        if fSum == i:
            equalFacts.append(fSum)
    return equalFacts

def factorial(n):
    if n == 0:
        return 1
    else:
        fact = n * factorial(n - 1)
        return fact
