You are viewing a single comment's thread. Return to all comments →
n=int(input()) for x in range(n): array=int(input()) a=(array*(array+1))/2 b=(2*array + 1)/3 result=a*(a-b) print(int(result))
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 →