project_euler.problem_034.sol1 ============================== .. py:module:: project_euler.problem_034.sol1 .. autoapi-nested-parse:: Problem 34: https://projecteuler.net/problem=34 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. Attributes ---------- .. autoapisummary:: project_euler.problem_034.sol1.DIGIT_FACTORIAL Functions --------- .. autoapisummary:: project_euler.problem_034.sol1.solution project_euler.problem_034.sol1.sum_of_digit_factorial Module Contents --------------- .. py:function:: solution() -> int Returns the sum of all numbers whose sum of the factorials of all digits add up to the number itself. >>> solution() 40730 .. py:function:: sum_of_digit_factorial(n: int) -> int Returns the sum of the factorial of digits in n >>> sum_of_digit_factorial(15) 121 >>> sum_of_digit_factorial(0) 1 .. py:data:: DIGIT_FACTORIAL