<s>[INST] Prove that $\lfloor\frac{n+1}{2}\rfloor+\lfloor\frac{n+2}{4}\rfloor+\lfloor\frac{n+4}{8}\rfloor+\lfloor\frac{n+8}{16}\rfloor+ \dots=n$ 
Prove $$\left[\dfrac{n+1}{2}\right]+\left[\dfrac{n+2}{4}\right]+\left[\dfrac{n+4}{8}\right]+\left[\dfrac{n+8}{16}\right] + \dots=n$$ 
  where $[x]=\lfloor x\rfloor$

$$$$
It was suggested that somehow I use the identity $[x]=\left[\dfrac x2\right]+\left[\dfrac{x+1}{2}\right]$$$$$After struggling for a while, I realised I wasn't getting anywhere using his hint, probably because I couldn't really understand how I was to use it. Instead I tried to use the Squeeze Theorem by rewriting the $nth$ term of the series (referred to later as S) as$$$$ $$t_n=\left[\dfrac{n+2^k}{2^{k+1}}\right] \text{ where } 0\le k<\infty$$
$$\Rightarrow \dfrac{n+2^k}{2^{k+1}}-1<\left[\dfrac{n+2^k}{2^{k+1}}\right]\le \dfrac{n+2^k}{2^{k+1}}$$
$$$$
$$ \lim_{k\to \infty}(k+1)\left(\dfrac{n+2^k}{2^{k+1}}-1\right)<S\le  \lim_{k\to \infty}(k+1)\left( \dfrac{n+2^k}{2^{k+1}}\right)$$
However these bounds are too loose as the limits diverge to $-\infty$ and $\infty$ respectively.
$$$$
Could somebody please show me how to prove the series is equal to $n$, either through the given hint, or through the selection of tighter bounds for the Squeeze Theorem? Many thanks!
 [/INST] Let's start with the observation that, for any integers $a,b\gt0$, 
$$\left\lfloor{a\over b}+{1\over2b}\right\rfloor=\left\lfloor{a\over b}\right\rfloor\quad(*)$$
Now define
$$f(n)=n-\left(\left\lfloor n+1\over2 \right\rfloor+\left\lfloor n+2\over4 \right\rfloor+\left\lfloor n+4\over8 \right\rfloor+\left\lfloor n+8\over16 \right\rfloor+\cdots \right)$$
Then
$$\begin{align}
f(2n)
&=2n-\left(\left\lfloor 2n+1\over2 \right\rfloor+\left\lfloor 2n+2\over4 \right\rfloor+\left\lfloor 2n+4\over8 \right\rfloor+\left\lfloor 2n+8\over16 \right\rfloor+\cdots \right)\\
&=2n-\left(\left\lfloor n+{1\over2} \right\rfloor+\left\lfloor n+1\over2 \right\rfloor+\left\lfloor n+2\over4 \right\rfloor+\left\lfloor n+4\over8 \right\rfloor+\cdots \right)\\
&=2n-\left(n+\left\lfloor n+1\over2 \right\rfloor+\left\lfloor n+2\over4 \right\rfloor+\left\lfloor n+4\over8 \right\rfloor+\cdots \right)\\
&=f(n)
\end{align}$$
and
$$\begin{align}
f(2n+1)
&=2n+1-\left(\left\lfloor 2n+2\over2 \right\rfloor+\left\lfloor 2n+3\over4 \right\rfloor+\left\lfloor 2n+5\over8 \right\rfloor+\left\lfloor 2n+9\over16 \right\rfloor+\cdots \right)\\
&=2n+1-\left(\left\lfloor n+1 \right\rfloor+\left\lfloor {n+1\over2}+{1\over4} \right\rfloor+\left\lfloor {n+2\over4}+{1\over8} \right\rfloor+\left\lfloor {n+4\over8}+{1\over16} \right\rfloor+\cdots \right)\\
&=2n+1-\left(n+1+\left\lfloor n+1\over2 \right\rfloor+\left\lfloor n+2\over4 \right\rfloor+\left\lfloor n+4\over8 \right\rfloor+\cdots \right)\quad\text{using (*)}\\
&=f(n)
\end{align}$$
Consequently $f(n)$ is a constant function for all $n\gt0$, so it suffices to evaluate
$$\begin{align}
f(1)&=1-\left(\left\lfloor 1+1\over2 \right\rfloor+\left\lfloor 1+2\over4 \right\rfloor+\left\lfloor 1+4\over8 \right\rfloor+\left\lfloor 1+8\over16 \right\rfloor+\cdots \right)\\
&=1-(1+0+0+0+\cdots)\\
&=0
\end{align}$$
</s>