import math
import time
st = time.time()
tot = 0
n = 3
while n < 10000000:
    num = 0
    s = str(n)
    l = len(s)
    for i in range(l):
        num += math.factorial(int(s[i]))
    if num == n:
        tot += num
        print(num)
    n += 1
et = time.time()
print(tot)
print(et - st)

6b2cae443ac2dd52f92113d2881b301055ab1dd8
<mask token>

<mask token>
while n < 10000000:
    num = 0
    s = str(n)
    l = len(s)
    for i in range(l):
        num += math.factorial(int(s[i]))
    if num == n:
        tot += num
        print(num)
    n += 1
<mask token>
print(tot)
print(et - st)

<mask token>
st = time.time()
tot = 0
n = 3
while n < 10000000:
    num = 0
    s = str(n)
    l = len(s)
    for i in range(l):
        num += math.factorial(int(s[i]))
    if num == n:
        tot += num
        print(num)
    n += 1
et = time.time()
print(tot)
print(et - st)

import math
import time
st = time.time()
tot = 0
n = 3
while n < 10000000:
    num = 0
    s = str(n)
    l = len(s)
    for i in range(l):
        num += math.factorial(int(s[i]))
    if num == n:
        tot += num
        print(num)
    n += 1
et = time.time()
print(tot)
print(et - st)
