This question is from number theory :
Set $n\in (1,2009)$, and $n$ is a natural number. Find the values of $n$ such that $$n\sqrt5 - \lfloor{n\sqrt5}\rfloor$$ is minimised and maximised respectively.
I tried to convert the expression into an inequality as such:
$$m^2<5n^2<(m+1)^2$$ With $m = \lfloor n\sqrt5\rfloor$. This came to no avail.
I have also tried to set $k = n\sqrt5 - \lfloor{n\sqrt5}\rfloor$. This way, to maximise $k$, we maximise:
$$k(k+2m) = 5n^2-m^2$$
$$n = \frac{k+m}{\sqrt5}$$ But this also turns out to not work. I tried plotting the function and testing for different values of n. Apparently, for $17$, the value of the function seems quite minimal, and for $21$ it appears to be more maximal. I have noticed that smaller numbers tend to be more extreme for this function, as$34 = 17\times2$ is also quite minimal, but not so much as $17$. This appears to show a link, but I cannot identify it.
Please help with the problem.
Another method is to use the familiar Fibonacci approximants for $\phi=(1+\sqrt{5})/2$. Rendering $\sqrt{5}=2\phi-1$, carry the upper bounds until you get a maximum odd denominator $\le 2009$, or a maximum even denominator $\le 2×2009$, and take whichever is later:
$\frac{2}{1},\frac{5}{3},\frac{13}{8},...\frac{1597}{987},\color{blue}{\frac{4181}{2584}}$
Do the same with the lower bounds:
$\frac{1}{1},\frac{3}{2},\frac{8}{5},...\frac{987}{610},\color{blue}{\frac{2584}{1597}}$
So the optimal bounds within the problem constraints are:
$\frac{2584}{1597}<\phi<\frac{4181}{2584}$
and with $\sqrt{5}=2\phi-1$:
$\frac{3571}{1597}<\sqrt{5}<\frac{2889}{1292}$.