Consider the binary representation of $n$:
$$n = \sum_{i=0,1,\ldots} a_i 2^i,\quad a_i\in\{0, 1\}$$
Consider the $k$th term of the sum (the term that adds to the $k$th bit and truncate), depending on whether the $k$th bit $a_k$ is $0$ or $1$:
- $a_k=1$ means the addition leads to a carry:
$$\left\lfloor\dfrac{n+2^k}{2^{k+1}}\right\rfloor = 1 + \sum_{i=(k+1), \ldots} \frac{a_i2^i}{2^{k+1}}$$
- While for $a_k = 0$, there's no carry and the term is just a truncation:
$$\left\lfloor\dfrac{n+2^k}{2^{k+1}}\right\rfloor = \sum_{i=(k+1), \ldots} \frac{a_i2^i}{2^{k+1}}$$
Either case,
$$\left\lfloor\dfrac{n+2^k}{2^{k+1}}\right\rfloor = a_k + \sum_{i=(k+1), \ldots}a_i2^{i-(k+1)}$$
Then consider the whole series with terms in the above form, the $i$th bit $a_i$ appears in:
- Terms $0\le k < i$, $\left\lfloor\dfrac{n+2^k}{2^{k+1}}\right\rfloor$ contributes $a_i2^{i-(k+1)}$ to the whole series;
- (or none if $i=0$, i.e. no less-significant bits;)
- Term $k = i$, $\left\lfloor\dfrac{n+2^k}{2^{k+1}}\right\rfloor$ contributes $a_i$ to the whole series;
- Terms $k > i$, bit $a_i$ is truncated and has no effects on those terms.
The overall contribution of a bit $a_i$ on the whole series is the additional
$$\left(a_i2^{i-1} + a_i2^{i-2} + \ldots + a_i2^0\right) + a_i = a_i2^i$$
And the overall contribution of all bits $a_0, a_1, \ldots$ is
$$\sum_{i=0,\ldots} a_i2^i = n$$