Skip to content

Instantly share code, notes, and snippets.

@goyuninfo
Last active August 29, 2015 14:01
Show Gist options
  • Save goyuninfo/0d8bbfa417cd381d49a9 to your computer and use it in GitHub Desktop.
Save goyuninfo/0d8bbfa417cd381d49a9 to your computer and use it in GitHub Desktop.
def sumDivisibleBy(n):
p=int(999/n)
return n * (p * (p + 1)) / 2
s=int(sumDivisibleBy(3) + sumDivisibleBy(5) - sumDivisibleBy(15))
print(s)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment