Let $n$ be a fixed natural number. a) Find all solutions to the following equation : \[ \sum_{k=1}^n [\frac x{2^k}]=x-1 \] b) Find the number of solutions to the following equation ($m$ is a fixed natural) : \[ \sum_{k=1}^n [\frac x{2^k}]=x-m \]
Problem
Source: Iran TST 2006
Tags: ceiling function, logarithms, algebra proposed, algebra
01.05.2006 19:00
Let $x=\sum_{i=0} a_i2^i , a_i \in \{0,1\}$. \[ \sum_{k=1}^n [\frac x{2^k}]=\sum_{k=1}^n \frac{x}{2^k}-\sum_{k=1}^n\{\frac{x}{2^k}\}=x-\frac{x}{2^n}-\sum_{k=1}^n \{\frac{x}{2^k}\}=x-\frac{x}{2^n}-\sum_{k=1}^{n} \sum_{i=0}^{k-1} a_i2^i=x-\frac{x}{2^n}-\sum_{i=0}^{n-1} a_i(1-\frac{1}{2^{n-i}})=x-[\frac{x}{2^n}]-\sum_{i=0}^{n-1}a_i. \] Therefore equation \[ \sum_{k=1}^n [\frac{x}{2^k}]=x-m \] equavalent to \[ [\frac{x}{2^n}]+\sum_{i=0}^{n-1} a_i =m \] and easy solved.
04.05.2006 19:48
The answer for b is $\sum_{i=0}^{m}\binom{n}{i}$
08.01.2013 09:58
rust,the number $ x $ must be an integer,not necessarily a positive one
14.01.2013 17:14
In this solution sketch, $m$ is a nonnegative integer. We know that there are $\sum_{i=0}^m \binom{n}{i}$ nonnegative solutions from earlier replies. If we include negative integers, it seems really messy. Note that $m<n$ must happen for a negative solution to exist. (Thus, if $m \geq n$, there are $\sum_{i=0}^m\binom{n}{i}=\sum_{i=0}^n \binom{n}{i} = 2^n$ solutions.) If $m=n-1$, $x=-1$ is the only negative solution, whence there are in total \[\sum_{i=0}^{n-1}\binom{n}{i}+1=2^n\] solutions in this case. From now on, we assume that $m \leq n-2$. There are \[\sum_{\ell=0}^{n-1} \binom{\ell}{n-2-m}=\binom{n}{n-1-m}=\binom{n}{m+1}\] negative solutions $x\geq -2^n$. The number of solutions $x<-2^n$ is more complicated and given by this monstrous summation \[{\sum_{\ell=1}^{\left\lceil{\log_2(n-m)}\right\rceil} \sum_{j=2^{\ell-1}+m+1}^{2^{\ell}+m}}\binom{n}{j}=\sum_{i=m+2}^{2^{\left\lceil{\log_2(n-m)}\right\rceil}+m}\binom{n}{i}\,.\] Therefore, the total number of solutions for $0 \leq m \leq n-2$ is \[\sum_{i=0}^{2^{\left\lceil{\log_2(n-m)}\right\rceil}+m} \binom{n}{i} = \sum_{i=0}^n \binom{n}{i}=2^n\,.\] The same answer holds if we take $m$ to be an arbitrary nonnegative real number. Judging from how simple the final answer looks, I think there might be a simple counting argument and it probably has something to do with expressing each nonzero integer as $\sum_{j=0}^N a_j 2^j$ where $a_j \in \{-1,+1\}$).
24.11.2014 22:44
Can you explain how do you get the answer on b)?
06.06.2022 02:02
We will be using the well known fact that $$ \sum_{j \ge 1} \left\lfloor \frac{x}{2^j} \right\rfloor = x - \text{sum of digits of } x \text{ when written in base } 2 \qquad \qquad (\star)$$It directly follows that all solutions to (a) are $$ \boxed{2^0,2^1,\ldots,2^n} $$We solve part (b) now. Write $$ x = \underbrace{\sum_{i=0}^{n-1} 2^ia_i}_{=y \text{ (say)}} + \underbrace{2^n \cdot l}_{=z \text{ (say)}}$$where each $a_i \in \{0,1\}$ and $l \in \mathbb Z_{\ge 0}$ (note as $x=0$ is clearly never a solution, so we don't need to worry about all $a_i$ and $l$ being equal to $0$). Using $(\star)$ we get $$ \sum_{k=1}^n \left\lfloor \frac{y}{2^k} \right\rfloor = \sum_{j \ge 1} \left\lfloor \frac{y}{2^j} \right\rfloor = y - \sum_{i=0}^{n-1} a_i $$On the other hand it is easy to compute $$ \sum_{k=1}^n \left\lfloor \frac{z}{2^k} \right\rfloor = z \left( \frac{1}{2} + \frac{1}{4} + \cdots + \frac{1}{2^n} \right) = z \left( 1- \frac{1}{2^n} \right) = z - l $$Now observe $$ \sum_{k=1}^n \left\lfloor \frac{x}{2^k} \right\rfloor = \sum_{k=1}^n \left\lfloor \frac{y}{2^k} \right\rfloor + \sum_{k=1}^n \left\lfloor \frac{z}{2^k} \right\rfloor = \left(y - \sum_{i=0}^{n-1} a_i \right) + (z - l) = x - \left( l + \sum_{i=0}^{n-1} a_i \right)$$Hence the given equation is equivalent to $$ l + \sum_{i=0}^{n-1} a_i = m $$Note for a fixed choice of $l,m$, there are $$ \binom{n}{m-l} $$solutions to the above equation, as we have to choose some $m-l$ of the $n$ $a_i$'s to equal $1$. Hence total number of solutions to (b) is $$ \sum_{l \ge 0} \binom{n}{m-l} = \boxed{ \sum_{i=0}^m \binom{n}{i} } $$This completes the proof. $\blacksquare$ Remark: In this proof we have assumed $x \ge 0$. For $x < 0$, weird things start happening like for $n=2$, $x=-1$ is a solution to (a). The Key reason is that $(\star)$ is no longer true for negative $x$. The reason is the following: Basically for $x \ge 0$, if we write $$ x = \sum_{i \ge 0} a_i2^i $$where $a_i \in \{0,1\}$, then we have $$ \sum_{j \ge 1} \left\lfloor \frac{x}{2^j} \right\rfloor \textcolor{red}{=} \sum_{i \ge 0} \left( \sum_{j=0}^i \left\lfloor \frac{a_i2^i}{2^j} \right\rfloor \right) = \sum_{i \ge 0} \left(a_i2^i - a_i \right) = x - \sum_{i \ge 0} a_i $$while if we try to do the same thing with $x < 0$ by taking $a_i \in \{0,-1\}$, then the red equality isn't true as some $-1$'s also pop, like for example $$ \left\lfloor \frac{-1 - 2}{2} \right\rfloor = \left\lfloor \frac{-1}{2} \right\rfloor + \left\lfloor \frac{-2}{2} \right\rfloor \textcolor{blue}{-1} $$where that extra $\textcolor{blue}{-1}$ is not there if $-1,-2$ are replaced by $1,2$.
16.06.2022 09:15
I got a somewhat complicated form which seems right (and also much easier to calculate) Assume $x \geq 0$ first of all and now let's introduces some notations , $v_p(a)$ is the highest power of $p$ in $a$ and $s_p(a)$ is the sum of digits in the base $p$ representation of $a$ where $p$ is a prime. a) Suppose $x \leq 2^{n+1} - 1$ then ${LHS} = v_2(x!) = x - s_2(x) = x - 1 \implies s_2(x) = 1 \implies x \in \{ 1 , 2 , \cdots , 2^n\}$ Now suppose $x \geq 2^{n+1} \implies {LHS} = v_2(x!) - \sum_{k \geq n+1} \left\lfloor \frac{x}{2^{n+1}} \right\rfloor = x - s_2(x) - \sum_{k \geq n+1} \left\lfloor \frac{x}{2^{n+1}} \right\rfloor = x - 1 \implies s_2(x) + \sum_{k \geq n+1} \left\lfloor \frac{x}{2^{n+1}} \right\rfloor = 1$ but note that $s_2(x) + \sum_{k \geq n+1} \left\lfloor \frac{x}{2^{n+1}} \right\rfloor \geq 1 + 1 = 2$ , Thus no solution here . Therefore all the solutions are $\{ 1 , 2 , \cdots , 2^n\}$. b)Let $\binom{a}{b} = 0$ if $b > a$ for $a,b$ positive integers. Now we begin with our solution , Suppose $x \leq 2^{n+1} - 1 \implies \text{The length of x as a binary string is atmost n}$ Then ${LHS} = x - s_2(x) = x - m \implies s_2(x) = m$ , Thus it suffices to count the number of binary strings of length $\geq m$ such that it has got $m$ $1$'s in it and that's exactly $$ \binom{m}{m} + \left(\binom{m+1}{m} - \binom{m}{m} \right) + \left(\binom{m+2}{m} - \binom{m+1}{m} + \binom{m}{m} \right) + \cdots = \binom{n+1}{m}$$ Now suppose $$x \geq 2^{n+1} \implies {LHS} = x - s_2(x) - \sum_{k \geq n+1} \left\lfloor \frac{x}{2^{n+1}} \right\rfloor = x - m \implies s_2(x) + \sum_{k \geq n+1} \left\lfloor \frac{x}{2^{n+1}} \right\rfloor = m$$Note that for $2^{n+i+1} > x \geq 2^{n+i}$ forall $i \geq 1 \implies \sum_{k \geq n+1} \left\lfloor \frac{x}{2^{n+1}} \right\rfloor = \sum_{k \geq n+1} \left\lfloor \frac{2^{n+i}}{2^{n+1}} \right\rfloor = 2^i - 1$ and also that the length of $x$ as a binary string is $= n+i+1$ with a leading $1$. Therefore for $2^{n+i+1} > x \geq 2^{n+i}$, $$ s_2(x) + 2^i - 1 = m \implies s_2(x) = m + 1 - 2^i$$for $i \leq \left\lfloor log_2(m) \right\rfloor$ and the number of solution to this is $\binom{n+i}{m - 2^i}$ , Therefore in total forall $i$ the number of solution is $\sum_{i=1}^{\left\lfloor log_2(m) \right\rfloor} \binom{n+i}{m-2^i}$ Thus the total number of solution to this is $\left(\sum_{i=1}^{\left\lfloor log_2(m) \right\rfloor} \binom{n+i}{m-2^i}\right) + \binom{n+1}{m}$.