an+1=an+2n-7
an=an-1 +2(n-1)-7
an-1=an-2+2(n-2)-7
.
a2=a+2(1-1)-7
左右两边加起来 an到a2都消去了
an+1=a+n(n+1)-7n
an=n^2-10n+12