Let $k \in \mathbb{N}$, let $x_k$ denote the nearest integer to $\sqrt k$. Show that for each $m \in \mathbb {N}$, $$\sum_{k=1}^{m} \frac{1}{x_k} = f(m)+ \frac{m}{f(m)+1}$$, where $f(m)$ is the integer part of $\frac{\sqrt{4m-3}-1}{2}$
Source: India Postals 2015 Set 3
Tags: number theory, function
Let $k \in \mathbb{N}$, let $x_k$ denote the nearest integer to $\sqrt k$. Show that for each $m \in \mathbb {N}$, $$\sum_{k=1}^{m} \frac{1}{x_k} = f(m)+ \frac{m}{f(m)+1}$$, where $f(m)$ is the integer part of $\frac{\sqrt{4m-3}-1}{2}$