I have this summation:
$\sum_{k=0}^x \lfloor{\frac{k}{c}}\rfloor$
Do you have any ideas on any general expressions that can approximate this?
P.S I know I can approximate it with a Fourier expansion using $\{\frac{k}{c}\} = \frac{k}{c} \mod 1$, which is a sawtooth function, if I reform it to $\lfloor{\frac{k}{c}\rfloor}=\frac{k}{c}-\{\frac{k}{c}\}$. However, I'm looking for something more general, easier to handle and computationally more tractable.
$c$ is an integer btw which I will need to iterate over in another step of my algorithm.
Thank you.
With $c$ integer, an exact solution is easy.
From $k=0$ to $k=c-1$, the terms are $0$.
From $k=c$ to $k=2c-1$, the terms are $1$.
From $k=2c$ to $k=3c-1$, the terms are $2$.
...
Let $q=\lfloor\dfrac xc\rfloor$. You have full "periods" ($c$ equal terms) from $k=0$ to $cq-1$, then an incomplete period from $cq$ to $x$ inclusive.
The total is
$$c\cdot0+c\cdot1+c\cdot2\cdots c\cdot(q-1)+(x-cq+1)q=c\frac{(q-1)q}2+(x-cq+1)q.$$