MCPcopy Index your code
hub / github.com/TheAlgorithms/Python / solution

Function solution

project_euler/problem_034/sol1.py:25–34  ·  view source on GitHub ↗

Returns the sum of all numbers whose sum of the factorials of all digits add up to the number itself. >>> solution() 40730

()

Source from the content-addressed store, hash-verified

23
24
25def 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
37if __name__ == "__main__":

Callers 1

sol1.pyFile · 0.70

Calls 2

factorialFunction · 0.90
sum_of_digit_factorialFunction · 0.85

Tested by

no test coverage detected