Let $(a_n)_{n\ge 1}$ be the sequence defined as the following :
$$a_1=1 ,\ a_{n+1}=\dfrac{a_n}{n} + \dfrac{n}{a_n} ,\ n\ge1$$
Show that for every $n\ge4,\ \lfloor a_n^2 \rfloor = n$.
My approach to this problem was trying induction and using the function $f_n(x)=\dfrac{x}{n} + \dfrac{n}{x}$ :
Proving the base case for $n= 4$ and then by the inductive hypothesis $\lfloor a_n^2 \rfloor = n$ implies that $$\sqrt{n} \le a_n \lt \sqrt{n+1}$$
We then apply $f_n$ knowing that it is decreasing in that interval following it up with the floor function and some polishing, all leads to this inequality : $$n+1\le \lfloor a_{n+1}^2 \rfloor \le n+2$$
So I can't exactly get $n+1$ since $n+2$ is a possibility, this problem is a product of the fact that if $a\lt b$ then $\lfloor a \rfloor \le \lfloor b \rfloor$.
Any insights would be greatly appreciated! I wonder if my result is correct because it seems like the only way.