<s>[INST] How do you solve $\sum_{k=0}^{\infty} \sum_{i=1}^{m-1} \left \lfloor \frac{x+im^k}{m^{k+1}} \right \rfloor$? Let $m > 1$ be an integer, x is a real number and $f(x)=\sum_{k=0}^{\infty} \sum_{i=1}^{m-1} \left \lfloor  \frac{x+im^k}{m^{k+1}}  \right \rfloor$
Do you have any idea how can I show this? 
$f(x)= 
\begin{cases}
    \left \lfloor x \right \rfloor & \text{if } x\geq 0\\
    \left \lfloor x+1 \right \rfloor & \text{if } x<0
\end{cases}$
 [/INST] The key to solving the sum is realising that for any $k$ you can write $x$ uniquely as $x = m^{k+1} q_{k+1} + m^k r_{k}$ with $q_{k+1} \in \mathbb{Z}$ and $r_k \in [0, m) \subset \mathbb{R}$. 
You can think of this as writing $x$ in base $m$ and splitting into two numbers corresponding to the first couple of digits and the remaining digits. For example if $x=1234.56$ and $m=10$ then $q_2 = 12$ and $r_{1} = 3.456$. We also have that
$$m^{k+1} q_{k+1} + m^k r_k = m^k q_k + m^{k-1} r_{k-1} = m^{k+1} q_{k+1} + m^k ((q_k - m q_{k+1}) + r_{k-1} /m)$$ so $r_k = (q_k - m q_{k+1}) + r_{k-1}/m$ which implies $\lfloor r_k \rfloor = (q_k - m q_{k+1})$. Which makes sense if you think of the integral part of $r_k$ as the 'next digit'.
Motivation aside, this notation makes it possible to simplify the sum as follows:
$$
\begin{align}
\sum_{k=0}^{\infty} \sum_{t=1}^{m-1} \left \lfloor 
  \frac{x+tm^k}{m^{k+1}}
\right \rfloor &=
\sum_{k=0}^{\infty} \sum_{t=1}^{m-1} \left \lfloor 
  \frac{m^{k+1} q_{k+1} + m^{k} r_{k} + tm^k}{m^{k+1}}
\right \rfloor \\&=
\sum_{k=0}^{\infty} \sum_{t=1}^{m-1} \left \lfloor 
q_{k+1} + \frac{(r_k +t)m^k}{m^{k+1}}
\right \rfloor \\&=
\sum_{k=0}^{\infty} \sum_{t=1}^{m-1}
q_{k+1} + \left \lfloor  
    \frac{r_k + t}{m}
\right \rfloor \\
&= \sum_{k=0}^{\infty} (m-1) q_{k+1} + \lfloor r_k \rfloor\\
&= \sum_{k=0}^{\infty} (m-1) q_{k+1} + (q_k - mq_{k+1})\\
&= \sum_{k=0}^{\infty} q_k - q_{k+1}
\end{align}
$$
Now note that
$$
\lim_{N\to\infty} \sum_{k=0}^{N} q_k - q_{k+1} = \lim_{N\to\infty} q_0 - q_N = q_0 = \begin{cases}
    \left \lfloor x \right \rfloor & \text{if } x\geq 0\\
    \left \lfloor x+1 \right \rfloor & \text{if } x<0
\end{cases}
$$
</s>