# Limit of alternating sum of fractional parts

Find

$$\newcommand{\pars}{\left\{ \frac{n}{#1} \right\}}$$

$$\lim_{n\to\infty}\dfrac{1}{n} \left( \pars{1} - \pars{2} + ... + (-1)^{n+1} \pars{n} \right),$$

where $$\left\{ x \right\}$$ denotes the fractional part of $$x$$.

My guess is that the limit is equal to 0; I tried finding some asymptotics for the fractional part sum, by looking for example at ways to bound $$\pars{k} - \pars{k+1}$$; My intuition is that this difference is rather small(perhaps less than $$\frac{n}{k(k+1)}$$) and that it is big enough to be relevant only when one of them is zero, meaning that $$k$$ or $$k+1$$ divides $$n$$. This would lead me to conjecture that it grows at most as $$O(\sqrt{n})$$, which would make the limit zero, but I have not been able to make this rigorous. Another idea I had would be to look at the sum with odd denominator and the sum with even denominators and show that they must be "rather" close; this seems pretty intuitive but the fractional part is very chaotic and I have not been able to get any bounds.

Any ideas/tips would be appreciated!

• – reuns Jan 17 '20 at 21:05

Yes, the limit is zero. Let's denote $$n_k=\lfloor n/k\rfloor$$. Then, for $$1\leqslant r\leqslant n$$, we have $$n_k=r\iff kr\leqslant n In particular, for "small" $$r$$, there are "long" runs of $$k$$ with the same value of $$n_k(=r)$$.
This leads to a solution. Let $$1. Splitting the sum $$\sum\limits_{k=1}^{n}=\sum\limits_{k=1}^{n_m}+\sum\limits_{r=2}^{m}\sum\limits_{k=n_r+1}^{n_{r-1}}$$, we get, crudely, $$\left|\sum_{k=1}^{n}(-1)^{k-1}\left\{\frac{n}{k}\right\}\right|\leqslant\underbrace{\left|\sum_{k=1}^{n_m}(-1)^{k-1}\left\{\frac{n}{k}\right\}\right|}_{ the second estimate holds because, under that sum, we have $$\lfloor n/k\rfloor=r-1$$ (see \eqref{basics}), hence $$\Bigg|\sum_{k=n_r+1}^{n_{r-1}}(-1)^{k-1}\underbrace{\left(\frac{n}{k}-r+1\right)}_{=\{n/k\}}\Bigg|\leqslant n\Bigg|\sum_{k=n_r+1}^{n_{r-1}}\frac{(-1)^{k-1}}{k}\Bigg|+(r-1)\Bigg|\sum_{k=n_r+1}^{n_{r-1}}(-1)^{k-1}\Bigg|<\frac{n}{n_r}+r.$$
Thus, we get an estimate $$\left|\sum_{k=1}^{n}(-1)^{k-1}\left\{\frac{n}{k}\right\}\right| and, taking $$m=\lfloor n^{1/3}\rfloor$$, we see that this is $$\mathcal{O}(n^{2/3})$$, which is sufficient.
This leaves the question whether there is a better estimate [than $$\mathcal{O}(n^{2/3})$$] open. Any refinements?..
• The asymptotic of $D(n)=\sum_{k\le n} \lfloor n/k\rfloor$ is the Dirichlet divisor problem, here it is $\sum_{k\le n} (-1)^k n/k-(D(n)-2D(n/2) )$ which is the same. I'd say doing better than $O(n^{1/2})$ needs the analytic methods in Titchmarsh – reuns Jan 17 '20 at 20:57