an=n*1/2^n
Sn=1*1/2+2*1/2^2+3*1/2^3+.+n*1/2^n
1/2Sn=1/2^2+2*1/2^3+3*1/2^4+...+n*1/2^(n+1)
Sn-Sn/2=1/2+1/2^2+1/2^3+.+1/2^n-n*1/2^(n+1)
Sn/2=1/2*(1-1/2^n)/(1-1/2)-n*1/(2^n*2)
故有Sn=2-2/2^n-n*1/2^n=2-(2+n)/2^n
an=n*1/2^n
Sn=1*1/2+2*1/2^2+3*1/2^3+.+n*1/2^n
1/2Sn=1/2^2+2*1/2^3+3*1/2^4+...+n*1/2^(n+1)
Sn-Sn/2=1/2+1/2^2+1/2^3+.+1/2^n-n*1/2^(n+1)
Sn/2=1/2*(1-1/2^n)/(1-1/2)-n*1/(2^n*2)
故有Sn=2-2/2^n-n*1/2^n=2-(2+n)/2^n