sequence converges to different value Im trying to study the sequence 
$$ x_{i+1} = 111- (1130-3000/x_{i-1})/x_i $$
with $x_1=11/2$ and $x_2 = 61/11$
Now, I implemented it in Matlab to see the behavoiur:
 x(1) = 11/2;
 x(2) = 61/11; 
 for k=2:20
    x(k+1) = 111-(1130-3000/x(k-1))/x(k);
    disp(x(k))
 end

but, this seems to be approaching $6$ first but suddenly it jumps to 100 at about $n=8 $ or so. Is my code wrong? or this sequence does have this behaviour?
 A: Nothing abnormal, because the corresponding "fixed point" 3rd degree equation 
$$x = f(x) \ \ \ \text{with} \ \ \ f(x):=111-(1130-3000/x)/x$$
has 3 real roots $5, \ 6, \ 100$ : thus, this sequence is just "jumping" from the vicinity of a fixed point ($6$) to another one ($100$).
One can get a good idea of what happens on the following figure with the graphical representation of $f$ intersecting the line bissector of the first quadrant at points $(5,5), \ (6,6), \ (100,100)$. On the same figure, we have placed points $(y_k,y_k)$ and $(y_k,y_{k+1})$ of the "cousin sequence" $(y_n)$ defined by  the first order recurrence relationship :
$$y_1=11/2 \ \ \text{and} \ \ y_{k+1} = 111-(1130-3000/y_{k})/y_{k}$$
Please note how the staircase pattern connects the two areas of $(6,6)$ and $(100,100)$.
Sequence $(y_n)$ is such that $y_n/x_n$ tends to $1$ when $n \to \infty$.

Remark : sequence ($x_n$) has become a classical (counter)example ; see for example Müller series : solving a recursive sequence with different initial conditions and an interesting discussion ; I think the origin of sequence $(x_n)$ can be traced to the book by Jean-Michel Muller "Arithmétique des ordinateurs" (Eyrolles Ed., 1989) : see https://perso.ens-lyon.fr/jean-michel.muller/chapitre1.pdf and http://www.mat.unb.br/~ayala/EVENTS/munoz2006.pdf
