Define a function $\displaystyle f(n) = n + \left \lfloor \sqrt{n} \right \rfloor$.

Find the smallest value of $k$ such that the composite function,

$f^{k} (2017) = \underbrace{f\circ f \circ f \circ \cdots \circ f}_{k \text{ times}} (2017)$ can be expressed as $m^2$ for some positive integer $m$.

Submit your answer as $m-k$.

$$ **Notation**: $\lfloor \cdot \rfloor$ denotes the floor function.