You are viewing a single comment's thread. Return to all comments →
for a0 in range(t): n = int(input().strip()) x = (sum([i for i in range(1, n + 1)])) ** 2 y = sum([i ** 2 for i in range(1, n + 1)]) print(x - y)
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #6: Sum square difference
You are viewing a single comment's thread. Return to all comments →