Untitled
unknown
plain_text
3 years ago
227 B
7
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...