Example 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.


Sample input:
4
5

Sample output:
1
5
14
30
1
5
14
30
55

Sample solutions


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