forked from Mrinank-Bhowmick/python-beginner-projects
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path5.py
More file actions
17 lines (15 loc) · 673 Bytes
/
5.py
File metadata and controls
17 lines (15 loc) · 673 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# Smallest multiple | https://projecteuler.net/problem=5
# -------------------------------------------------------------------------------
# 2520 is the smallest number that can be divided by each of the numbers
# from 1 to 10 without any remainder.
#
# What is the smallest positive number that is evenly divisible by all of the
# numbers from 1 to 20?
# -------------------------------------------------------------------------------
def sm(to: int) -> int:
"""int to: 1-?"""
divisors = [x for x in range(1, (to + 1))]
for i in range(2520, __import__("sys").maxsize, to):
if all(i % x == 0 for x in divisors):
return i
print(sm(20))