【projecteuler.net】题目 5

新博客地址:http://gorthon.sinaapp.com/

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?




>>> print 2520*11*13*17*19*2
232792560
>>> 

下面是看结果能不能被1到20整除:
>>> for i in range(2, 21):
             if 232792560 % i != 0:
                    print i
                    break



>>>

什么也没发生说明正确了。

你可能感兴趣的:(each,Numbers)