I am working on the Project Euler problems. I am on Problem 1 and for some reason I am getting the wrong answer for it. I don't know if its my math logic that's the problem or if the logic for the code is wrong. Here's the code:
def getSumMult3_5(n):
count = 0
i = 0
i_1 = 0
while i*5 < n:
count += i*5
i += 1
while i_1*3 < n:
count += i_1*3
i_1 += 1
return count
print getSumMult3_5(1000)
It's returning that
count = 266333
but that is not the correct answer. Count should equal 233168. Can anybody help me figure out why it's doing this?
Thanks!