Infinite sum of floor functions I need to compute this (convergent) sum
$$\sum_{j=0}^\infty\left(j-2^k\left\lfloor\frac{j}{2^k}\right\rfloor\right)(1-\alpha)^j\alpha$$
But I have no idea how to get rid of the floor thing. I thought about some variable substitution, but it didn't take me anywhere.

Note: This answer uses Iverson brackets to cope with the floor function. Although this may need some more lines, the calculations are easy and can be performed  this way  more or less mechanically. The answer was inspired by example (1.14) of Two Notes on Notation by D. Knuth.

For convenience only we set $N=2^k$. We obtain
\begin{align*}
\sum_{j=0}^{\infty}&\left(j-N\left\lfloor\frac{j}{N}\right\rfloor\right)(1-\alpha)^j\alpha=\\
  &=\alpha\sum_{j=0}^{\infty}\sum_m(j-Nm)(1-\alpha)^j\left[m=\left\lfloor\frac{j}{N}\right\rfloor\right]\tag{1}\\
  &=\alpha\sum_{j=0}^{\infty}\sum_m(j-Nm)(1-\alpha)^j\left[m\leq \frac{j}{N}<m+1\right]\tag{2}\\
  &=\alpha\sum_{j=0}^{\infty}\sum_m(j-Nm)(1-\alpha)^j\left[Nm\leq j <N(m+1)\right]\\
  &=\alpha\sum_{m=0}^{\infty}\sum_{j=Nm}^{N(m+1)-1}(j-Nm)(1-\alpha)^j\tag{3}\\
  &=\alpha\sum_{m=0}^{\infty}\sum_{j=0}^{N-1}j(1-\alpha)^{j+Nm}\\
  &=\alpha\left({\sum_{m=0}^{\infty}(1-\alpha)^{Nm}}\right)\left(\sum_{j=0}^{N-1}j(1-\alpha)^j\right)\\
  &=\frac{\alpha}{1-(1-\alpha)^N}\left({\sum_{j=0}^{N-1}j(1-\alpha)^j}\right)\\
  &=-\frac{\alpha}{1-(1-\alpha)^N}\frac{d}{d\alpha}\left(\sum_{j=0}^{N-1}j(1-\alpha)^{j-1}\right)\\
  &=-\frac{\alpha}{1-(1-\alpha)^N}\frac{d}{d\alpha}\frac{1-(1-\alpha)^N}{\alpha}\\
  &=-\frac{\alpha}{1-(1-\alpha)^N}\left[\frac{N(1-\alpha)^{N-1}}{\alpha}-\frac{1-(1-\alpha)^N}{\alpha^2}\right]\\
  &=\frac{1-\alpha}{\alpha}-\frac{N(1-\alpha)^N}{1-(1-\alpha)^N}
\end{align*}

Comment:


*

*In (1) we immediately get rid of the floor function and shift it into the logical statement within the Iverson brackets. We introduce thereby a new variable $m$ and use it to sum over the complete range of integers.

*In (2) we use the relationship $x\leq \lfloor x\rfloor < x+1$ to further simplify things

*In (3) we exchange the sums and restrict the limits of $j$ and $m$ accordingly. So, we don't need the Iverson brackets any longer and the following is routine work.
