Untitled

 avatar
unknown
plain_text
2 years ago
227 B
4
Indexable
# User input for n

n = int(input())

# Sum of the squares of the first n numbers
sum = (n*(n+1)*(2*n+1))/6
print(int(sum))

total = 0
for i in range(1,n+1):
    total += i

total *= total

print(int(total - sum))
Editor is loading...