n=1时,2S1=2a1=a2-2²+1=a2-3
a2=2a1+3
n=2时,2S2=2(a1+a2)=2(a1+2a1+3)=6a1+6=a3-2³+1=a3-7
a3=6a1+13
a1、a2+5、a3成等差数列,则
2(a2+5)=a1+a3
2(2a1+3+5)=a1+6a1+13
整理,得
3a1=3
a1=1
2Sn=a(n+1)-2^(n+1)+1=S(n+1)-Sn -2^(n+1)+1
S(n+1)=3Sn +2^(n+1) -1
S(n+1)+2^(n+2) -1/2=3Sn+3×2^(n+1) -3/2=3[Sn+2^(n+1) -1/2]
[S(n+1)+2^(n+2) -1/2]/[Sn +2^(n+1) -1/2]=3,为定值
S1+2² -1/2=a1+4-1/2=1+4-1/2=9/2,数列{Sn +2^(n+1) -1/2}是以9/2为首项,3为公比的等比数列
Sn +2^(n+1) -1/2=(9/2)×3^(n-1)=(1/2)×3^(n+1)
Sn=(1/2)×3^(n+1) -2^(n+1) +1/2
n≥2时,an=Sn-S(n-1)=(1/2)×3^(n+1) -2^(n+1) +1/2 -[(1/2)×3ⁿ-2ⁿ+1/2]=3ⁿ-2ⁿ
n=1时,a1=3-2=1,同样满足通项公式
数列{an}的通项公式为an=3ⁿ-2ⁿ