# # Solution to Project Euler problem 1 # Copyright (c) Project Nayuki. All rights reserved. # # https://www.nayuki.io/page/project-euler-solutions # https://github.com/nayuki/Project-Euler-solutions # # Computers are fast, so we can implement this solution directly without any clever math. def compute(): ans = sum(x for x in range(1000) if (x % 3 == 0 or x % 5 == 0)) return str(ans) if __name__ == "__main__": print(compute())