Comparison: SN = 1 / 2 + 2 / 4 + 3 / 8 + 4 / 16 +The nth power of N / 2 (n is a positive integer) is clearly related to the size of 2 I don't understand every step, especially subtraction

Comparison: SN = 1 / 2 + 2 / 4 + 3 / 8 + 4 / 16 +The nth power of N / 2 (n is a positive integer) is clearly related to the size of 2 I don't understand every step, especially subtraction

Sn=1/2+2/4+3/8+4/16…… +n/2^n.(1)
2Sn=1+2/2+3/4+4/8…… +n/2^(n-1).(2)
(2) - (1) get
Sn=1+1/2+1/4+1/8+1/16+.-n/2^n.
Sn=2[1-(1/2)^n]-n/2^n.=2-[2^(-n)+n/2^n]