The sum of the squares of the first ten natural numbers is,
12 + 22 + ... + 102 = 385
The square of the sum of the first ten natural numbers is,
(1 + 2 + ... + 10)2 = 552 = 3025
Hence the difference between the sum of the squares of the first ten natural numbers and the square of the sum is 3025 − 385 = 2640.
Find the difference between the sum of the squares of the first one hundred natural numbers and the square of the sum.
It's simple.
'problem solving > Project Euler in Haskell' 카테고리의 다른 글
ProjectEuler Problem 5 - Smallest multiple (0) | 2014.12.04 |
---|---|
ProjectEuler Problem 4 - Largest palindrome product (0) | 2014.12.03 |
ProjectEuler Problem 3 - Largest prime factor (0) | 2014.12.03 |
ProjectEuler Problem 2 - Even Fibonacci numbers (0) | 2014.12.01 |
ProjectEuler Problem 1 - Multiples of 3 and 5 (0) | 2014.12.01 |