n=input("n=");
S=0;
for k=1:n
    S=S+k*2^(k-1)
end
afficher("S = "+string(S));
R=(n-1)*2^n;
afficher("R = "+string(R))