Find an "upper bound" for a given sequence. Let $a_1=5$ and let $$a_{n+1}=\frac{a_n^2}{a_n^2-4a_n+6}$$
Find the biggest integer $m$ not bigger than $a_{2018}$, that is $m\leq a_{2018}$.
My go:
Apparently the limit must satisfy $$l=\frac{l^2}{l^2-4l+6}\Leftrightarrow l=0\vee l=3\vee l=2$$ Computing first few terms i see that $a_n\to 3$ as $n\to\infty$. The sequence seems to converge to 3, so i tried to show that $\forall n\geq 2,a_n\leq3$ proceeding by induction, we find that $a_1=5,a_2=25/11\approx2,27\leq3$. Now let $a_n\leq 3\Rightarrow a_{n+1}=\frac{a_n^2}{a_n^2-4a_n+6}\leq\frac{9}{a_n^2-4a_n+6}$ but here I'm stuck again, no idea what to do with the denominator. Any help appreciated.

Suppose we compute the fixed points of the iteration $x\mapsto\frac{x^2}{x^2-4x+6}$; those fixed points are 0, 2 and 3. Now analyse the stability of those fixed points; a fixed point $x_0$ of $x\mapsto f(x)$ is stable (attractive) if $|f'(x_0)|<1$.
The numerator of the derivative of the given map is
$$2x(x^2-4x+6)-x^2(2x-4)$$
and for $x=2$ this is 8, but for $x=3$ this is 0. Furthermore, this expression is non-negative over $[2,3]$. Therefore, since $2<a_2<3$, the sequence monotonically converges to 3 from below after $a_1$, so $m=2$.
