Consider the following serie:
$\sum_{i=1}^x \lfloor \frac xi \rfloor = \sum_{i=1}^x \sigma(x)$
Where $\sigma(x)$ is the sum of divisors function.
This is easy to understand because if you take for example x=31, you would do $\frac {31}{1}=31 $ which means that there is 31 multiples of 1 from 1 to 31, $\frac {31}{2}=15\frac {1}{2} $, wich means that there is 15 multiples of 2, and that we are halfway to the next multiple of 2, and so on. Using the floor function, we get the exact number of multiples of each integers from 1 to x that are in that same range.
There is no explicit formula to calculate this sum, because of the floor function, but we can approximate:
$\sum_{i=1}^x \frac xi = x\sum_{i=1}^x \frac 1i = xH(x) \approx x(ln(x)+\gamma)$
So i got interested in the part that was removed by the floor function:
$\sum_{i=1}^x \frac xi - \lfloor \frac xi \rfloor$
and realised that it can be approximate because when x gets bigger, the part removed by the floor function converge to $ x(1-\gamma)$.
I aslo tried to the same logic for the ceiling function and the result makes sens:
$\sum_{i=1}^x \frac xi - \lfloor \frac xi \rfloor \approx x(1-\gamma)$
$\sum_{i=1}^x \frac xi - \lceil \frac xi \rceil \approx -\gamma x$
I did found documentation for all of this on the web, like the Dirichlet's asymptotic formula (http://dlmf.nist.gov/27.11), but i got confused when i tried it with the standard round function. At first, i thought that the result would be right between $x(1-\gamma)$ and $-\gamma x$, so $x(1-2\gamma)$ but instead, the part removed by the round function converge to 0.03648 * x... I did not found anything on the web about this number, and i cant find any relation to the $\gamma$ constant. I did not paid much attention to it until i saw it for a 2nd time, when i tried this:
$\sum_{i=1}^x \frac {1}{i} - ln(x) \approx \gamma$
$\sum_{i=1}^x \frac {1}{i+1} - ln(x) \approx \gamma-1$
$\sum_{i=1}^x \frac {1}{i+\frac{1}{2}} - ln(x) \approx -0.03648$
Can someone explain this behavior ?
$$\sum_{i=1}^n\frac1{i+\frac12}=2\sum_{i=1}^n\frac1{2i+1}=2\sum_{i=2}^{2n}\frac1i-2\sum_{i=1}^n\frac1{2i}=2H_{2n}-2-H_n=2\ln 2n+2\gamma-\ln n-\gamma\\ =\ln n+2\ln2-2+\gamma\approx \ln n-0.0364899739786$$