Given $n\in\mathbb{N}_{\gt 0}$ provide a closed formula for
$$ f(n):=\sum_{l=0}^{\lceil\log_2(n)\rceil} \bigg\lceil\frac{n}{2^l}\bigg\rceil $$
If there is $k\in\mathbb{N}$, such that $n=2^k$, we have
$$ f(n)=\sum_{l=0}^{k} 2^{k-l}=2^{k+1}-1 $$
obviously, but what about other numbers?
Another easy observation is:
$$ f(2n+2) = 1 + f(2n+1)\quad{}(n\in\mathbb{N}_{\gt 0}) $$
but I was not able to use that, to provide a closed formula.
This is not homework, it us just an itch I could not scratch for now. If there was a formula for that sum, I could calculate some memory requirement for a function I am implementing more precisely. At the moment, I just overestimate it using $f(n) \le f(2^k)$ if $n \le 2^k$.