loading

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.8997776259083456","path":"main.py","file":{"path":"main.py","content":{"asEncoding":{"base64":"ZGVmIHN1bW4obiwgZCk6ICNzdW0gbnVtYmVycyA8PSBuIHRoYXQgYXJlIGRpdmlzaWJsZSBieSBkCiAgICBuIC8vPSBkCiAgICByZXR1cm4gZCpuKihuKzEpIC8vIDIKTCA9IGludChpbnB1dCgnRW50ZXIgYSBsaW1pdD8nKSkKYSwgYiA9IDMsIDUKcyA9IHN1bW4oTC0xLCBhKSArIHN1bW4oTC0xLCBiKSAtIHN1bW4oTC0xLCBhKmIpCnByaW50ICJTdW0gb2YgbXVsdGlwbGVzIG9mIixhLCJvciIsYiwiYmVsb3ciLCBMLCAiPSIsIHM="},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
def sumn(n, d): #sum numbers <= n that are divisible by d
    n //= d
    return d*n*(n+1) // 2
L = int(input('Enter a limit?'))
a, b = 3, 5
s = sumn(L-1, a) + sumn(L-1, b) - sumn(L-1, a*b)
print "Sum of multiples of",a,"or",b,"below", L, "=", s