设s=2^1+2^2+2^3+2^4.......+2^n 2s=2^2+2^3+2^4.......+2^n+12s-s=2^n+1-22^1+2^2+2^3+2^4.......+2^n=2^(n+1)-2
sum(2.^(1:n));
n=input('n=')x=1:n;y=2.^x;sum(y)