fork download
  1. def sod(divisor, limit):
  2. last = (limit - (limit - 1) % divisor) // divisor
  3. return last * (last + 1) // 2 * divisor
  4.  
  5. print(sod(3, 1000) + sod(5, 1000) - sod(15, 1000))
Success #stdin #stdout 0.03s 9316KB
stdin
Standard input is empty
stdout
233168