How to solve these kind of recurrence relations using matrices:
$$A_{n+1} = \sqrt 2 (A_n + B_n) - \sqrt 3 (A_n - B_n)$$ $$B_{n+1} = \sqrt 2 (A_n - B_n) + \sqrt 3 (A_n + B_n)$$
with initial $A_0$ and $B_0$ given.
I want a general idea about how to make the matrix which can be used to solve these kind of recurrence relations.
Thanks.
Let $$M=\begin{pmatrix} \sqrt2-\sqrt3&\sqrt2+\sqrt3\\ \sqrt2+\sqrt3&-\sqrt2+\sqrt3 \end{pmatrix}$$
Then $$\begin{pmatrix}A_n\\ B_n\end{pmatrix} = M^n \begin{pmatrix}A_0\\B_0\end{pmatrix}$$
So you need to compute $M^n$ quickly. This can be done by repeated squaring. Note that $\mathrm{tr} M=0$ and $\det M = -(\sqrt{3}-\sqrt2)^2-(\sqrt3+\sqrt2)^2 = -10$. So $M^2-10I=0$, which greatly helps you calculate powers of $M$.