Problem1024--数列求和

1024: 数列求和

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 136  Solved: 76
[Status] [Submit] [Creator:]

Description

小明写出了一个数列,第iai的值为i的2次方(即ai=i*i)。数列从第一项(i = 1)开始如下:

1, 4, 9, 16, 25, …

编程求出这个数列前 n 项的和。



Input

整数 n (1 ≤ n ≤ 1,000)

Output

一个整数: a1 + a2 + ⋯ + an的值。

Sample Input Copy

6

Sample Output Copy

91

Source/Category