a1=1+1/2
22=2+1/4=2+(1/2)^2
...
a(n)=n+(1/2)^n
Sn=a1+a2+...+an
=(1+2+3+...+n)+(1/2+1/4+...+1/2^n)
=n*(n+1)/2+1-(1/2)^n