数列{an},a1=1,an+1=2an-n^2+3n,求{an}.