# Section 5.2
# 51180
k = 0
total = 0

while k <= 50:
    total = total + (k * k)
    k = k + 1

# 51181
total = 0
k = 1

while k <= n:
    total = total + (k * k * k)
    k = k + 1

# 51176
k = 0
total = 0

for k in range (1, 51):
    total = total + (k * k)

# 51177
k = 0
total = 0

for k in range (n + 1):
    total = total + k * k * k

# 51259
avg = (1 + n) / 2