I was doing some basic Number Theory problems and came across this problem :
Show that for any integer $n$ $\geq$ $1$ ; $$\sum_{i=0}^\infty [\frac{n}{2^i}+\frac{1}{2}] = 2n$$ ; where $[x]$ represents the greatest integer / floor function
I am all thumbs , even a hint would suffice
P.S. In the book , this question is given in the section on the Greatest Integer Function , perhaps that might help . Also , this is not a homework question , I am just practicing number theory questions on my own from the book
use this Hermit identity $$[x]+[x+\dfrac{1}{2}]=[2x]\Longrightarrow [x+\dfrac{1}{2}]=[2x]-[x]$$ so $$[\dfrac{n}{2^i}+\dfrac{1}{2}]=[\dfrac{n}{2^{i-1}}]-[\dfrac{n}{2^i}]$$ so $$\sum_{i=0}^{\infty}[\dfrac{n}{2^i}+\dfrac{1}{2}]=n+\sum_{i=1}^{\infty}\left([\dfrac{n}{2^{i-1}}]-[\dfrac{n}{2^i}]\right)=2n$$