What is the sum of all terms of n-1 power of finite sequence 1,1 + 2,1 + 2 + 4.1 + 2 + 4 +... + 2?

What is the sum of all terms of n-1 power of finite sequence 1,1 + 2,1 + 2 + 4.1 + 2 + 4 +... + 2?

an=1+2+…… +2^(n-1)=1*(1-2^n)/(1-2)=2^n-1
So Sn = 2 ^ 1-1 + 2 ^ 2-1 + +2^n-1
=(2+…… +2^n)-(1+1+…… +1)
=2*(1-2^n)/(1-2)-n
=2^(n+1)+2-n
Hope to adopt!