Project Euler with Ruby on WSL [Problem 6]
ネタばれあり
ですよっと
問題
The sum of the squares of the first ten natural numbers is, The square of the sum of the first ten natural numbers is, 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.
私訳
1 から 100 までの自然数の、(和の2乗)-(2乗和) を求めよ
解答方針
中学生時代が懐かしいですねぇ。 と を思い出せば、問われているのは
ということになります。 試しに 10 を入れてみると 9101132/12 = 310118 = 2640 で正しそうですね。