Let, there is two variable $N$ and $D$. Now, I want to find the closed form of the following sum:
$$S_n = \sum_{k=1}^N \lfloor{\frac{k}{D}+\frac{1}{2}}\rfloor$$
Its easy to find the closed form by seeing the pattern. But, As to broaden my understanding of the material of the 3rd chapter of the book Concrete Mathematics, I want to use the Iversion's convention and use the index manipulation.
It can be written as $$S_n = \sum_k \lfloor{\frac{k}{D}+\frac{1}{2}}\rfloor[1 \le k \le N]$$
$$=\sum_{k, m} m [m = \lfloor{\frac{k}{D}+\frac{1}{2}}\rfloor][1 \le k \le N]$$ $$=\sum_{k, m} m [m \le \frac{k}{D}+\frac{1}{2} < m+1][1 \le k \le N]$$ $$=\sum_{k, m} m [\frac{k}{D}-\frac{1}{2} < m \le \frac{k}{D}+\frac{1}{2}][1 \le k \le N]$$
And, I am lost. Can you point an error in my approach and/or guide me to the right path? Thanks in advance.