TITLE: Approximating a weird sum
QUESTION [5 upvotes]: How can I approximate the sum$$\sum_{k=1}^n
\left(\frac{2k}{n} \left\lceil \frac{n}{k} \right\rceil \left\{ \frac{n}{k} \right\}-1\right)$$
where $\{x\}$ is the fractional part function, and $\lceil x\rceil$ is the ceiling function.
I know that if I divide by $n$ and let $n\to\infty$, it's equal to $0$.  At first I thought the sum might be of the order $n^a$, but now I think it could be logarithmic.  The partial sums are really weird.  I would appreciate any help on giving an approximate value to the sum.

REPLY [2 votes]: An observation: let $\rm f(n)=\sum_{k=1}^n
\left(\frac{2k}{n} \left\lceil \frac{n}{k} \right\rceil \left\{ \frac{n}{k} \right\}-1\right)$ and $\rm \mu(n)$ be the mean of $\rm f(1),\ldots,f(n)$.  Then $\rm \mu(n)$ is logarithmic:
.
as is the standard deviation:

so you could probably come up with a numerical estimate for a bound as a function of $\rm n$ pretty easily, though it appears that $\rm f$ is unbounded as $\rm n\rightarrow\infty$.
EDIT: The upper and lower bounds actually seem to behave like those of the Divisor Summatory function.  Maybe you should look at that.