若n=2k
Sn=(4+3(2k-1)+1)/2+2^k-2
=2^k+3k-1
=2^(n/2)+3n/2-1
若n=2k+1
Sn=2^k+3k-1+3(2k+1)+1
=2^k+9k+3
=2^((n-1)/2)+9n/2-3/2