an=n+(1/2)^n;
Sn=1+1/2+2+1/4+3+1/8+.+n+(1/2)^n;
=(1+2+3+.+n)+(1/2+1/4+1/8+.(1/2)^n);
=n(n+1)/2 +(1-(1/2)^n);
明白,刚才复杂化了!