Project Euler Python解题汇总 005 ~ 010

What is Project Euler?
Project Euler is a series of challenging mathematical/computer programming problems that will require more than just mathematical insights to solve. Although mathematics will help you arrive at elegant and efficient methods, the use of a computer and programming skills will be required to solve most problems.

The motivation for starting Project Euler, and its continuation, is to provide a platform for the inquiring mind to delve into unfamiliar areas and learn new concepts in a fun and recreational context.

这些解基本上都是用Python暴力解出来的,没有经过优化,只求答案不起速度,但是为了知道运算在什么位置了还加了一些额外的附加代码的,哇咔咔。

问题5:
What is the smallest number divisible by each of the numbers 1 to 20?
求1,2,..,19,20的最小公倍数。

问题6:
Find the difference between the sum of the squares of the first one hundred natural numbers and the square of the sum.
求1至100和的平方与1至100的平方和之差。

问题7:
Find the 10001st prime.
求第10001个素数(质数)。

问题8:
Discover the largest product of five consecutive digits in the 1000-digit number.
在给定的1000个数中,求出连续5个数的最大乘积。

问题9:
Find the only Pythagorean triplet, {a, b, c}, for which a + b + c = 1000.
求满足a+b+c = 1000的勾股数的积。(注:勾股数指满足a^2+b^2=c^2的自然数a,b,c)

问题10:
Calculate the sum of all the primes below two million.
求2,000,000以内所有素数的和。

-EOF-