# How to simplify$\sum_{i = 0}^{k - 1}{5^{i}\left(\frac{n}{2^{i}}\right)^{2}\left(\lg\frac{n}{2^{i}}\right)^{2}}$

I am trying to find a way to express

$$\sum_{i = 0}^{k - 1}{5^{i}\left(\frac{n}{2^{i}}\right)^{2}\left(\lg\frac{n}{2^{i}}\right)^{2}}$$

without the summation as a formula. I was thinking it might be a geometric series with first term $$a = n^2\left(\lg n\right)^{2}$$, and $$r = \frac{5}{4}\left(\lg_n (\frac{1}{2}) + 1\right)^{2}$$. Which leads to a really messy closed form summation formula. I am not sure that my approach is correct as a result. How can I write this summation as a closed formula?

We have the formulas $$\sum_{i=0}^{k-1}r^i=\frac{1-r^k}{1-r}\tag1$$ $$\sum_{i=0}^{k-1}ir^i=\frac{r-kr^k+(k-1)r^{k+1}}{(1-r)^2}\tag2$$ $$\sum_{i=0}^{k-1}i^2r^i=\frac{r(1+r)-r^k(r+((k-1)r-k)^2)}{(1-r)^3}\tag3$$
which, assuming that $$n$$ does not depend on $$i$$, we can apply to \begin{align} &\sum_{i=0}^{k-1}5^i\left(\frac{n}{2^i}\right)^2\left(\log\left(\frac{n}{2^i}\right)\right)^2\\ &=n^2\sum_{i=0}^{k-1}\left(\frac54\right)^i\left(\log(n)^2-2i\log(n)\log(2)+i^2\log(2)^2\right)\\ &=4n^2\log(n)^2\left(\left(\frac54\right)^k-1\right)-8n^2\log(n)\log(2)\left(5+\left(\frac54\right)^k(k-5)\right)\\ &+4n^2\log(2)^2\left(\left(\frac54\right)^k\left((k-5)^2+20\right)-45\right)\\ &=4n^2\left(\frac54\right)^k\left[(\log(n)-\log(2)(k-5))^2+20\log(2)^2\right]\\[6pt] &-4n^2\left[\log(n)^2+10\log(n)\log(2)+45\log(2)^2\right]\tag4 \end{align}