You are viewing a single comment's thread. Return to all comments →
for _ in range(int(input())): x = int(input()) s1 =0 s2 =0 for i in range(0,x+1): s1 += i*i for i in range(0,x+1): s2 += i s2 = pow(s2,2) print(s2-s1)
Project Euler #6: Sum square difference
You are viewing a single comment's thread. Return to all comments →
Python3