매일매일 IT
[JavaProgramming] Sum square difference 본문
자바ㅠㅠ!! 합 제곱 차이
The sum of the squares of the first ten natural numbers is,
12 + 22 + ... [ 12 + 22 + ...] + 102 = 385 [ + 102 = 385]
The square of the sum of the first ten natural numbers is,
(1 + 2 + ... [ (1 + 2 + ...] + 10)2 = 552 = 3025 [ + 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.
'Programming Language > JAVA' 카테고리의 다른 글
[JavaProgramming] Largest product in a series (0) | 2018.01.31 |
---|---|
[JavaProgramming] 10001st prime (0) | 2018.01.28 |
[JavaProgramming] Smallest multiple (0) | 2018.01.28 |
[JavaProgramming] Largest palindrome product (0) | 2018.01.27 |
[JavaProgramming] Largest prime factor (0) | 2018.01.26 |
Comments