diff options
Diffstat (limited to 'progs/a300.py')
-rw-r--r-- | progs/a300.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/progs/a300.py b/progs/a300.py new file mode 100644 index 0000000..46b0b05 --- /dev/null +++ b/progs/a300.py @@ -0,0 +1,12 @@ +def smallest_multiple(n):
+ if (n<=2):
+ return n
+ i = n * 2
+ factors = [number for number in range(n, 1, -1) if number * 2 > n]
+ while True:
+ for a in factors:
+ if i % a != 0:
+ i += n
+ break
+ if (a == factors[-1] and i % a == 0):
+ return i
\ No newline at end of file |