Last active
August 29, 2015 14:01
-
-
Save goyuninfo/0d8bbfa417cd381d49a9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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