Does $\sum_{i=1}^{k-1}\lceil \log_2\frac{N}{i}\rceil$ have a closed form?

86 Views Asked by At

Does the following have a closed formula?

$$\sum_{i=1}^{k-1}\left\lceil \log_2\frac{N}{i}\right\rceil$$

1

There are 1 best solutions below

0
On

Let \begin{align*} S(k,N) &= \sum_{i=1}^{k-1}\left\lceil \log_2\frac{N}{i}\right\rceil \end{align*}

We can have a closed form for $S(N,N)$ which is: \begin{align*} S(N,N) &= 2^{\lceil\log_2N \rceil+1}-\lceil\log_2N \rceil-2 \end{align*}

and the sequence $S(N,N)-S(k,N)\; \; , k = N,N-1,N-2,\ldots, 3,2,1$ is A005187, which gives us interesting information.