Sample challenge

You are given some natural numbers as input. For each number n, the program should compute the sum 12 + 22 + 32 + ... + n2, listing all partial sums and the global sum

Example
input
4
5

output
1
5
14
30
1
5
14
30
55

Sample solutions


function foo(items) { var x = "All this is syntax highlighted"; return x; }