Returns the sum of all numbers whose sum of the factorials of all digits add up to the number itself. >>> solution() 40730
()
| 23 | |
| 24 | |
| 25 | def solution() -> int: |
| 26 | """ |
| 27 | Returns the sum of all numbers whose |
| 28 | sum of the factorials of all digits |
| 29 | add up to the number itself. |
| 30 | >>> solution() |
| 31 | 40730 |
| 32 | """ |
| 33 | limit = 7 * factorial(9) + 1 |
| 34 | return sum(i for i in range(3, limit) if sum_of_digit_factorial(i) == i) |
| 35 | |
| 36 | |
| 37 | if __name__ == "__main__": |
no test coverage detected