AlgoWiki

Floor sum

Sums of the form $$\sum_{i=1}^n \left\lfloor \frac{pi+q}{r} \right\rfloor$$ can be evaluated in $O(\log n)$ time. See Summation of Floor Function Series for a special case.

Problems

External links