Why does this summation of ones give this answer? I saw this in a book and I don't understand it.
Suppose we have nonnegative integers $0 = k_0<k_1<...<k_m$ - why is it that
$$\sum\limits_{j=k_i+1}^{k_{i+1}}1=k_{i+1}-k_i?$$

Because $1+1+\cdots+1=n$ if there are $n$ ones.
So $j$ going from $k_i+1$ to $k_{i+1}$ is the same as going from $1$ to $k_{i+1}-k_i$ since the summand doesn't depend on $j$. There are $k_{i+1}-k_i$ ones in the list.
