\[{s(d,c)=\sum_{r=1}^{c-1}\frac{r}{c}\left(\frac{dr}{c}-\left\lfloor\frac{dr}{c}%
\right\rfloor-\frac{1}{2}\right),}\]