Problem 1


If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.

Find the sum of all the multiples of 3 or 5 below 1000.

answer = 0
for x in range(1,1000):
	if(((x % 3) == 0) or ((x % 5) == 0)):
		answer += x

print answer

答え : 233168

1000未満だからこれでいいのかな。。。?
登録してみようかな。。。
誰かやりたい人居ない?<追記>
日本語発見!!!


10未満の自然数のうち、3 もしくは 5 の倍数になっているものは 3, 5, 6, 9 の4つがあり、これらの合計は 23 になる。

同じようにして、1,000 未満の 3 か 5 の倍数になっている数字の合計を求めよ。

1000未満だから1000は考えなくていいのか♪