1*n+2*(n-1)+3*(n-2)+4*(n-3)+...+(n-2)*3+(n-1)*2+n*1
=1*n+2*(n-1)+3*(n-2)+4*(n-3)+...+(n-2)*[n-(n-3)]+(n-1)*[n-(n-2)]+n*[n-(n-1)]
=1*n+2*n+3*n+...+n*n-[2*1+3*2+4*3+...+n*(n-1)]
=n(1+2+3+...+n)-[2*1+3*2+4*3+...+n*(n-1)]
=n*n(n+1)/2-[2*1+3*2+4*3+...+n*(n-1)]
2*1+3*2+4*3+...+n*(n-1)
=1*0+2*1+3*2+4*3+...+n*(n-1)
实际上就是:An=n*(n-1)的前n项和
下面推导:
An=n*(n-1)=n^2-n
Sn=1^2+2^2+3^2+……+n^2-(1+2+3+4+...+n)
=1^2+2^2+3^2+……+n^2-n(n+1)/2
因为:
n^3-(n-1)^3=1*[n^2+(n-1)^2+n(n-1)]
=n^2+(n-1)^2+n^2-n
=2*n^2+(n-1)^2-n
2^3-1^3=2*2^2+1^2-2
3^3-2^3=2*3^2+2^2-3
4^3-3^3=2*4^2+3^2-4
.
n^3-(n-1)^3=2*n^2+(n-1)^2-n
各等式全相加
n^3-1^3=2*(2^2+3^2+...+n^2)+[1^2+2^2+...+(n-1)^2]-(2+3+4+...+n)
n^3-1=2*(1^2+2^2+3^2+...+n^2)-2+[1^2+2^2+...+(n-1)^2+n^2]-n^2-(2+3+4+...+n)
n^3-1=3*(1^2+2^2+3^2+...+n^2)-2-n^2-(1+2+3+...+n)+1
n^3-1=3(1^2+2^2+...+n^2)-1-n^2-n(n+1)/2
3(1^2+2^2+...+n^2)=n^3+n^2+n(n+1)/2=(n/2)(2n^2+2n+n+1)
=(n/2)(n+1)(2n+1)
1^2+2^2+3^2+...+n^2=n(n+1)(2n+1)/6
故
Sn=1^2+2^2+3^2+……+n^2-(1+2+3+4+...+n)
=n(n+1)(2n+1)/6 -n(n+1)/2
所以:
1*n+2*(n-1)+3*(n-2)+4*(n-3)+...+(n-2)*3+(n-1)*2+n*1
=n*n(n+1)/2-[2*1+3*2+4*3+...+n*(n-1)]
=n*n(n+1)/2-[n(n+1)(2n+1)/6 -n(n+1)/2]
=n(n+1)^2/2-n(n+1)(2n+1)/6
=n(n+1)*[3(n+1)-(2n+1)]/6
=n(n+1)(n+2)/6