Prove that for any positive integer $n$, \[\left\lfloor \frac{n+1}{2}\right\rfloor+\left\lfloor \frac{n+2}{4}\right\rfloor+\left\lfloor \frac{n+4}{8}\right\rfloor+\left\lfloor \frac{n+8}{16}\right\rfloor+\cdots = n.\]
Problem
Source:
Tags: floor function, induction
25.05.2007 03:25
Interesting. Notice that $\left \lfloor {\frac{n+2^k}{2^{k+1}}}\right \rfloor=\left \lfloor {\frac{n}{2^k}}\right\rfloor -\left \lfloor \frac{n}{2^{k+1}}\right \rfloor$
14.08.2008 05:32
I want to know if there is any other solution than the one given by Hawk Tiger!!!!!
15.08.2008 02:03
Here is a rather contrived proof (but still a proof nonetheless): Consider the binary representation of $ n$: $ n=2^{u_0}+2^{u_1}+\cdots+2^{u_t}$. Then it is easy to see that $ \left\lfloor\frac{n+2^{k-1}}{2^k}\right\rfloor=2^{u_i-k}+2^{u_{i+1}-k}+\cdots+2^{u_t-k} +(0)\text{ if }u_{i-1}<k-1\text{ and }+(1)\text{ if }u_{i-1}=k-1$ for $ u_i\ge k$. Thus, the sum in question is equivalent to $ (2^{u_0-1}+2^{u_0-2}+\cdots+1)+(2^{u_1-1}+2^{u_1-2}+\cdots+1)+\cdots+(2^{u_t-1}+2^{u_t-2}+\cdots+1)+t+1$ $ =2^{u_0}-1+2^{u_1}-1+\cdots+2^{u_t}-1+t+1$ $ =n$
25.08.2008 08:23
I am not sure but can someone (maybe peter) check out if this problem appeared in the 1968 IMO?
25.08.2008 09:25
See here. The second solution is essentially Hawk Tiger's and the first is essentially the cosinator's.
16.01.2013 22:32
and then represent $n$ as $n=2^{n} +m$ so that m is less than $2^{n}$.
13.03.2016 21:08
Here's a way to see why the identity is true and also why Hawk Tiger's identity is true. Consider all the numbers less than or equal to $n$. We count which of these have $v_2$ equal to 0, 1, 2, and so on. Let $k$ be fixed;we are counting the number of nonnegative $m$ such that $2^{k+1}m + 2^k \le n$. This is simply $\left\lfloor\dfrac{n+2^k}{2^{k+1}}\right\rfloor$. Summing over all $k$, we get the desired result. For Hawk Tiger's identity, note that the first term is just the number of multiples of $2^k$ and we subtract the second term which is the number of multiples of $2^{k+1}$
16.05.2020 08:39
awesome trick