# A limit about the greatest integer function [duplicate]

Let $[x]$ be the greatest integer function. How to find $\displaystyle\lim_{n\to\infty}\frac{1}{n}\sum_{k=1}^{n}\left(\left[\frac{2n}{k}\right]-2\left[\frac{n}{k}\right]\right)$?

Hints: Under what condition(s) will $$\left[\frac{2n}k\right]-2\left[\frac nk\right]=0?$$ For how many of $k=1,...,n$ will this occur (you may want to do an $n$ odd case and an $n$ even case)? When it is non-zero, what is this difference? What can you conclude from this about $$\frac1n\sum_{k=1}^n\left(\left[\frac{2n}k\right]-2\left[\frac nk\right]\right)$$ when $n$ is odd? What about when $n$ is even? Now what?