Find a formula for the sequence $(a_n)$ I would appreciate if somebody could help me with the following problem

Q : Find $a_n=?$

$$a_1=1, a_{n+1}=\frac{a_n+4}{a_n+1}(n=1,2,3,\cdots) $$
HINT：

Step 1:

Solve:$$x=\frac{x+4}{x+1}$$ first.
You get $x=2$,and $x=-2$.

Step 2:

Divide
$$a_{n+1}+2=\frac{a_n+4}{a_n+1}+2,$$
and
$$a_{n+1}-2=\frac{a_n+4}{a_n+1}-2.$$
You get $$\frac{a_{n+1}+2}{a_{n+1}-2}=(-3)\frac{a_{n}+2}{a_{n}-2}.$$

Step 3:

Set $b_n=\frac{a_{n}+2}{a_{n}-2}$,so $b_1=-3.$

You get $$b_n=(-3)^n.$$

Step 4:

Solve $\frac{a_{n}+2}{a_{n}-2}=(-3)^n.$

You get $$a_n=2\cdot{} \frac{(-3)^n+1}{(-3)^n-1}$$

PS:I don't know why people just voted down.
An idea:

$$a_{n+1}=\frac{p_{n+1}}{q_{n+1}}\;,\;\;\text{with}\;\;q_{n+1}=p_n+q_n\;,\;\;p_{n+1}=\begin{cases}2q_{n+1}+1&amp;,\;\;\;n\;\;\text{is odd}\\{}\\2q_{n+1}-1&amp;,\;\;\;n\;\;\text{is even}\end{cases}$$