Let $N \ge 1$ be an integer, and there is a series $ \{ N \mod 1, N \mod 2, ... , N \mod i, ... \}$. Obviously when $i \gt N+1$, the series will become $\{N, N, N, ..., \}$. So only take $i \le N$ into consideration.
My question is: does there exist some formula or fast algorithm to compute out the partial sum $\sum_{k=1}^i (N\mod k)$ (tranverse from 1 to i in brute force is trivial) ? If not, does there exist some formula or fast algorithm for some special case of i, for example $i = N, i = N/2$, etc.
P.S. I tried to google it but cannot find proper key words.