an=2^n-1
a1=2-1
a2=2^2-1
a3=2^3-1
Sn=2-1+2^2-1+2^3-1+.+2^n-1
=2+2^2+2^3+...+2^n+1*n
=-2(1-2^n)+n
=2^(n+1)+n-2