sum(i^2 * 2^(n-1-i)), i=1 to (n-2)