2. Given the sequence $\left\{a_{n}\right\}$ satisfies the first term $a_{1}=2, a_{n+1}$ $=\frac{2 a_{n}+6}{a_{n}+1}$. Find the general term formula of the sequence $\left\{a_{n}\right\}$.
(Prompt: Example 3. Answer: $a_{n}=\frac{3 \times 4^{n}+2(-1)^{n}}{4^{n}-(-1)^{n}}$.)