Am trying to prove that $$\sum_{k = 0}^d 2^k \log(\frac{n}{2^k})= 2^{d+1} \log (\frac{n}{2^{d-1}}) - 2 - \log n$$ I don't know how to go about it. Any ideas?
I have tried to change the $2^k \log (\frac{n}{2^k})$ to $2^k \log n - 2^k \log 2^k$. Please help.
Hint: You are off to a good start: $2^k \log (\frac{n}{2^k})$ to $2^k \log n - 2^k \log 2^k=2^k\log(n)-2^k k$. Adding this for $k$ from $0$ to $d$ gives $(2^{d+1}-1)\log(n)-2^{d+1}(d-1)-2.$ Can you take it from here?