http://acm.hdu.edu.cn/showproblem.php?pid=1178
等差求和公式s=n(n+1)/2=n/2+n^2/2。。。
sum=1+3+6+………………+i(i+1)(i+2)/6
=1+(1+2)+(1+2+3)+…………(1+2+3+……n)
=1/2+1^2/2+2/2+2^2/2+…………n/2+n^2/2
=n(n+1)/2/2+n(n+1)(n+2)/6/2
=n(n+1)(n+2)/6.