1,a(n+1)=2an+n²-4n+2
a(n+1)+n²=2an+2n²-4n+2
=2[an+(n²-2n+1)]
=2[an+(n-1)²]
而a1+(1-1)²=1+0=1≠0
所以数列{an+(n-1)²}是以1为首项、2为公比的等比数列
2,an+(n-1)²=1×2^(n-1)
那么an=2^(n-1)-(n-1)² (n∈N+)
所以Sn=[1+2+2²+2^3+……+2^(n-1)]-[0²+1²+2²+……+(n-1)²]
=1×(1-2^n)/(1-2)-(n-1)n(2n-1)/6
=(2^n)-1-[n(n-1)(2n-1)/6]