第 5 题:最小倍数
Problem 5: Smallest Multiple
目录
题目
最小倍数
是可以被 至 中的每一个数整除的最小数。
求能被 至 中的每一个数整除的最小正整数。
Smallest Multiple
is the smallest number that can be divided by each of the numbers from to without any remainder.
What is the smallest positive number that is evenly divisible by all of the numbers from to ?
解题方法
显然,答案为 至 中的每一个数进行素因数分解后,取最大的次方并相乘。
对 至 分解素因数见下表:
- | 2 | 3 | 5 | 7 | 11 | 13 | 17 | 19 |
---|---|---|---|---|---|---|---|---|
1 | ||||||||
2 | 1 | |||||||
3 | 1 | |||||||
4 | 2 | |||||||
5 | 1 | |||||||
6 | 1 | 1 | ||||||
7 | 1 | |||||||
8 | 3 | |||||||
9 | 2 | |||||||
10 | 1 | 1 | ||||||
11 | 1 | |||||||
12 | 2 | 1 | ||||||
13 | 1 | |||||||
14 | 1 | 1 | ||||||
15 | 1 | 1 | ||||||
16 | 4 | |||||||
17 | 1 | |||||||
18 | 1 | 2 | ||||||
19 | 1 | |||||||
20 | 2 | 1 | ||||||
最高次方 | 4 | 2 | 1 | 1 | 1 | 1 | 1 | 1 |
因此答案为
参考代码
|
|