sum i*2^i, i=1 to n