Not sure if I should\'ve posted this on math.stackexchange instead, but it includes more programming so I posted it here.
The question seems really simple, but I\'ve
result = 0 for i in range(0,1000): if (i % 3 == 0 or i % 5 == 0): print i result = result + i print result
Output:
0 3 5 6 9 . . . 993 995 996 999 233168