If $f(n)$ be the integer closest to $\sqrt{n}.$ then value of $ \sum^{2016}_{k=1}\frac{1}{f(k)}$ If $f(n)$ be the integer closest to $\sqrt{n}.$ then value of $\displaystyle \sum^{2016}_{k=1}\frac{1}{f(k)}$
could some help me with ths, thanks
 A: Hint $$k-\frac{1}{2} \leq \sqrt{n} < k+\frac{1}{2} \Leftrightarrow k^2-k+\frac{1}{4} \leq n <k^2+k+\frac{1}{4}$$
There are $2k$ integers for which $f(n)=\frac{1}{k}$.
A: Taking a cue from sequence A000194 in the OEIS, we have $$S = \sum_{k=1 }^{2016} \frac{1}{f (k)}$$ $$ = \frac {2}{1} + \frac {4}{2} + \frac {6}{3} + \cdots + \frac {2 \lfloor \sqrt {2016} \rfloor}{\lfloor \sqrt {2016} \rfloor} + \frac {36}{\lceil \sqrt {2016} \rceil}\,\,(\text{ why? })$$ $$=2+2+2\cdots +2  +\frac {36}{45} $$ where $2$ is added $44$ times giving an answer of $\boxed {88.8} $.
Hope it helps. 
A: If $j$ is a positive integer, the integers $n$ for which the closest integer to $\sqrt{n}$ is $j$ are those who verify $j-1/2<\sqrt{n}<j+1/2$, i.e. $j^2-j<n \leqslant j^2+j$. Then you can group terms:
$$\sum_{k=1}^{m^{2}+m}\frac{1}{f(k)}=\sum_{j=1}^{m}\sum_{k=j^2-j+1}^{j^2+j}\frac{1}{f(k)}=\sum_{j=1}^{m}\sum_{k=j^2-j+1}^{j^2+j}\frac{1}{j}=\sum_{j=1}^{m}2=2m.$$
In particular, noticing $44 \times 45=1980$ and $45 \times 46=2070$, we get $\sum_{k=1}^{1980}\frac{1}{f(k)}=88$. Moreover, the next $36$ terms verify $f(k)=45$, so we get
$$\sum_{k=1}^{2016}\frac{1}{f(k)}=88+\frac{36}{45}=\frac{444}{5}.$$
Best regards,
Tig la Pomme
