#Project Euler 34
def factorial(num):
    ans = 1
    for i in range(1, num+1):
        ans *= i
    return ans
def breakFact(num):
    num = list(str(num))
    ans = 0
    for n in num:
        ans += factorial(int(n))
    return ans
ans = 0
for i in range(3, 1000000):
    if breakFact(i) == i:
        print(i)
        ans+=i
print(ans)
        
        

8c753f67c5923ce31eab50735307a1f44ce62084
<mask token>


def breakFact(num):
    num = list(str(num))
    ans = 0
    for n in num:
        ans += factorial(int(n))
    return ans


<mask token>

def factorial(num):
    ans = 1
    for i in range(1, num + 1):
        ans *= i
    return ans


def breakFact(num):
    num = list(str(num))
    ans = 0
    for n in num:
        ans += factorial(int(n))
    return ans


<mask token>

def factorial(num):
    ans = 1
    for i in range(1, num + 1):
        ans *= i
    return ans


def breakFact(num):
    num = list(str(num))
    ans = 0
    for n in num:
        ans += factorial(int(n))
    return ans


<mask token>
for i in range(3, 1000000):
    if breakFact(i) == i:
        print(i)
        ans += i
print(ans)

def factorial(num):
    ans = 1
    for i in range(1, num + 1):
        ans *= i
    return ans


def breakFact(num):
    num = list(str(num))
    ans = 0
    for n in num:
        ans += factorial(int(n))
    return ans


ans = 0
for i in range(3, 1000000):
    if breakFact(i) == i:
        print(i)
        ans += i
print(ans)

#Project Euler 34
def factorial(num):
    ans = 1
    for i in range(1, num+1):
        ans *= i
    return ans
def breakFact(num):
    num = list(str(num))
    ans = 0
    for n in num:
        ans += factorial(int(n))
    return ans
ans = 0
for i in range(3, 1000000):
    if breakFact(i) == i:
        print(i)
        ans+=i
print(ans)
        
        
