A Floor Function based limit $\large{ \lim_{n \to \infty} \dfrac{1}{n^2} \sum_{k=1}^{n-1} \ k \cdot \left \lfloor x + \dfrac{n-k-1}{n} \right \rfloor = \ ? }$
Find the value of the above limit upto 3 decimal places when $(x = \sqrt{2015})$.
Any suggestions on how to handle the floor function?
 A: By my comment above, some of the floor functions will evaluate to $\lfloor x\rfloor$, and some to $\lfloor x + 1\rfloor = \lfloor x\rfloor +1$. If we move that $+1$ out to a separate sum, we get
$$
\frac{1}{n^2} \sum_{k=1}^{n-1} \ k \cdot \left \lfloor x + \dfrac{n-k-1}{n} \right \rfloor = \frac{1}{n^2}\left( \sum_{k=1}^{n-1} \ k\lfloor x\rfloor + \sum_{k = 1}^{i_n} k\right)
$$
for some $i_n$. More specifically, $i_n$ is the largest integer that satisfies
$$
\frac{n-i_n-1}{n} \geq1-\{x\}\\
\frac{i_n+1}{n}\leq \{x\}
$$
where $\{x\} = x-\lfloor x\rfloor$ is the fractional part of $x$. In any case, it is roughly proportional to $n$ as $n$ grows, with the proportionality factor closing in on $\{x\}$. Let $a_n = i_n/n$ be this proportionality factor.
These two sums are arithmetic, which means we can calculate them as follows:
$$
\sum_{k=1}^{n-1} \ k\lfloor x\rfloor + \sum_{k = 1}^{i_n} k = \frac{n(n-1)}{2}\lfloor x\rfloor + \frac{i_n(i_n+1)}{2}\\
= \frac{n^2 - n}{2}\lfloor x\rfloor + \frac{a_n^2n^2+ a_nn}{2}
$$
Now, this is supposed to be multiplied by $1/n^2$, and this yields:
$$
\frac{1-1/n}{2}\lfloor x\rfloor + \frac{a_n^2 + a_n/n}{2}
$$
In this expression it is safe to let $n$ go to $\infty$, and we get
$$
\frac{\lfloor x\rfloor + \{x\}^2}{2}
$$
(remember that $\lim_{n \to \infty} a_n = \{x\}$). Lastly, we can insert $x = \sqrt{2015}$, which gives
$$
\frac{44 + (\sqrt{2015} - 44)^2}{2} = \frac{44 + 2015 - 88\sqrt{2015} + 1936}{2}\\
= \frac{3995 - 88\sqrt{2015}}{2}
$$
