递推法:
an+1=an+2n-1
an=a(n-1)+2(n-1)-1
an-1=a(n-2)+2(n-2)-1
...
a2=a1+2-1;
叠加an+1=2(n+n-1+n-2...+2+1)-n+a1=n(n+1)-n+1=n^2+1,
an=(n-1)^2+1;
递推法:
an+1=an+2n-1
an=a(n-1)+2(n-1)-1
an-1=a(n-2)+2(n-2)-1
...
a2=a1+2-1;
叠加an+1=2(n+n-1+n-2...+2+1)-n+a1=n(n+1)-n+1=n^2+1,
an=(n-1)^2+1;