By accident I came across the following,


$$\lim\_{n\to\infty}\frac{1}{n}\sum\_{r=1}^n\frac{n\ (\mathrm{mod}\ r)}{r}=0.4227\ldots\approx 1-\gamma,$$


where the numerator is the remainder of $n$ divided by $r$. Is it known whether we have equality in the above expression or is it just a numerical coincidence? Has this been studied?


Edit: I'm sorry for all the (important) typos, everything should be fixed now.



Limit of $\frac{1}{n}\sum_{r=1}^n\frac{n\ (\mathrm{mod}\ r)}{r}$
This follows by elementary computation: we have
\begin{align}
\sum\_{r=1}^n\frac{n\bmod r}r&=\sum\_{r\le n}\frac nr-\sum\_{r\le n}\left\lfloor\frac nr\right\rfloor\\\\
&=nH\_n-|\{(r,s)\in\mathbb N^2:1\le rs\le n\}|\\\\
&=nH\_n-2\sum\_{r\le\sqrt n}\left\lfloor\frac nr\right\rfloor+\lfloor\sqrt n\rfloor^2\\\\
&=nH\_n-2nH\_{\lfloor\sqrt n\rfloor}+n+O(\sqrt n),
\end{align}
hence
\begin{align}
\frac1n\sum\_{r=1}^n\frac{n\bmod r}r&=H\_n-2H\_{\lfloor\sqrt n\rfloor}+1+O(n^{-1/2})\\
&=\log n+\gamma-2\log\lfloor\sqrt n\rfloor-2\gamma+1+O(n^{-1/2})\\\\
&=1-\gamma+O(n^{-1/2}).
\end{align}


