If we list all the natural numbers below that are multiples of or , we get and . The sum of these multiples is . Find the sum of all the multiples of or below . code example
Example: find the sum of all the multiples of 3 or 5 below 1000 python
nums = [3, 5]
result = 0
for i in range(0,1000):
if i%3 == 0 or i%5 == 0:
result += i
print(result)