an=n(n+1)=n^2+2n
所以Sn=(1^2+2^2+……+n^2)+2*(1+2+……+n)
=n(n+1)(2n+1)/6+2*n(n+1)/2
=n(n+1)[(2n+1)/6+1]
=n(n+1)(2n+7)/6