S(n)=2a(n)-2^n
当n=1时,
S(1)=a(1)=2a(1)-2^1
得 a(1)=2;
n=2时,
S(2)=a(1)+a(2)
=2a(2)-2²
解得
a(2)=a(1)+2²=2+4=6;
n=3时,
S(3)=a(1)+a(2)+a(3)
=2a(3)-2³
解得
a(3)=a(1)+a(2)+2³=2+6+8=16;
n=4时,
S(4)=a(1)+a(2)+a(3)+a(4)
=2a(4)-2^4
解得
a(4)=a(1)+a(2)+a(3)+2^4=2+6+16+16=40.