project_euler.problem_005.sol2 ============================== .. py:module:: project_euler.problem_005.sol2 Functions --------- .. autoapisummary:: project_euler.problem_005.sol2.lcm project_euler.problem_005.sol2.solution Module Contents --------------- .. py:function:: lcm(x: int, y: int) -> int Least Common Multiple. Using the property that lcm(a, b) * greatest_common_divisor(a, b) = a*b >>> lcm(3, 15) 15 >>> lcm(1, 27) 27 >>> lcm(13, 27) 351 >>> lcm(64, 48) 192 .. py:function:: solution(n: int = 20) -> int Returns the smallest positive number that is evenly divisible (divisible with no remainder) by all of the numbers from 1 to n. >>> solution(10) 2520 >>> solution(15) 360360 >>> solution(22) 232792560