n=int(input())
s=0
for i in range(1,n+1):
    t=i**2
    s=s+t
    print(t)
print("La suma es:",s)



Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: