Tag Archives: J
Project Eular Question 020 - 021
Posted by Shawn Zhang
on March 24, 2012
No comments
Question 20
n! means n * (n - 1) * ... * 3 * 2 * 1
For example, 10! = 10 * 9 * ... * 3 * 2 * 1 = 3628800,
and the sum of the digits in the number 10! is 3 + 6 + 2 + 8 + 8 + 0 + 0 = 27.
Find the sum of the digits in the number 100!
Solution :
sum([int(i) for i in list(str(reduce(lambda x,y:x *y,range(1,100))))])
Question 21
The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17.
Find the sum of all the primes below two million.
I've found that is really cool in Read more [...]