Approximating the sum of a series of mod functions

77 Views Asked by At

For some $N>0$ and $1\leq k\leq N$, let us denote $R_{k,N}=N\%k$ as the remainder of dividing $N$ by $k$. Then it is clear that $0\leq R_{k,N}\leq k-1$. I am interested in approximating the sum below as $N\rightarrow\infty$ and some $K\leq N$: $$ S_{K,N}=\sum_{k=1}^K (R_{k,N}-R^2_{k,N}/k). $$ What I find is that, since $R_{k,N}-R^2_{k,N}/k$ is quadratic in $R_{k,N}$, we must have $R_{k,N}-R^2_{k,N}/k\leq k/4$, where the equality is obtain at $R_{k,N}=k/2$. Therefore we must have: $$ S_{K,N}\leq\sum_{k=1}^K\frac{k}{4}=\frac{K(K+1)}{8}.$$ By experiment, I find that the following approximation appears to be very precise: $$ S_{K,N}\approx\sum_{k=1}^K\frac{k}{6}= \frac{K(K+1)}{12}.$$ The following figures show the quality of the approximation (note that the legend $K/2$ in the left figures should be $K$): enter image description here enter image description here I tried to prove this result but have no idea where to begin with. Am I missing something very obvious here?