sum k/2^(n-(k+1)), k = 1 to n-1