Example challenge

We call the number 1+2+...+k the k-th triangular number and denote it T_k. The input of the program contains a certain number of positive integers. For each integer n provided at input, the program should compute and print to output the sum of the first n triangular numbers, T_1 + T_2 + ... + T_n.

For instance, for n=3 we have:

T_1 = 1
T_2 = 1 + 2
T_3 = 1 + 2 + 3

T_1 + T_2 + T_3 = 10


Example input:

1
3
10

Example output

1
10
220

Sample solutions


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