12.4. Let the matrix $A=\left(\begin{array}{cc}1 & -2 \\ -2 & 1\end{array}\right)$. Determine $A^{2021}$.
Solution 1. We observe that $A^{2}=\left(\begin{array}{cc}5 & -4 \\ -4 & 5\end{array}\right), A^{3}=\left(\begin{array}{cc}13 & -14 \\ -14 & 13\end{array}\right)$.

Using mathematical induction, we prove that $A^{n}=\left(\begin{array}{ll}a_{n} & b_{n} \\ b_{n} & a_{n}\end{array}\right)$.

Indeed, suppose that $A^{n}=\left(\begin{array}{ll}a_{n} & b_{n} \\ b_{n} & a_{n}\end{array}\right)$. Then

$$
A^{n+1}=\left(\begin{array}{ll}
a_{n} & b_{n} \\
b_{n} & a_{n}
\end{array}\right)\left(\begin{array}{cc}
1 & -2 \\
-2 & 1
\end{array}\right)=\left(\begin{array}{ll}
a_{n}-2 b_{n} & b_{n}-2 a_{n} \\
b_{n}-2 a_{n} & a_{n}-2 b_{n}
\end{array}\right)=\left(\begin{array}{cc}
a_{n+1} & b_{n+1} \\
b_{n+1} & a_{n+1}
\end{array}\right)
$$

where $a_{n+1}=a_{n}-2 b_{n}, b_{n+1}=b_{n}-2 a_{n}$.

Using the conditions $a_{n+1}=a_{n}-2 b_{n}, b_{n+1}=b_{n}-2 a_{n}$, we obtain

$$
\begin{gathered}
a_{n+2}=a_{n+1}-2 b_{n+1}=a_{n+1}-2\left(b_{n}-2 a_{n}\right)=a_{n+1}-2 b_{n}+4 a_{n}= \\
=a_{n+1}+\left(a_{n+1}-a_{n}\right)+4 a_{n}=2 a_{n+1}+3 a_{n}
\end{gathered}
$$

Thus, we have obtained that $a_{n+2}=2 a_{n+1}+3 a_{n}$, which implies $a_{n+2}+a_{n+1}=3\left(a_{n+1}+a_{n}\right)$.

Denoting $x_{n}=a_{n+1}+a_{n}$, the last equality takes the form $x_{n+1}=3 x_{n}$.

Considering that $x_{1}=a_{2}+a_{1}=6$, we get $x_{n+1}=6 \cdot 3^{n}=2 \cdot 3^{n+1}$.

Then $a_{n+2}+a_{n+1}=2 \cdot 3^{n+1}$, and $a_{n+1}+a_{n}=2 \cdot 3^{n}$.

Using mathematical induction, we prove that $a_{n}=\frac{1}{2}\left(3^{n}+(-1)^{n}\right)$.

Indeed: $a_{1}=1$. Suppose that $a_{n}=\frac{1}{2}\left(3^{n}+(-1)^{n}\right)$.

Then

$$
a_{n+1}=2 \cdot 3^{n}-a_{n}=2 \cdot 3^{n}-\frac{1}{2}\left(3^{n}+(-1)^{n}\right)=\frac{3}{2} \cdot 3^{n}-\frac{1}{2}(-1)^{n}=\frac{1}{2}\left(3^{n+1}+(-1)^{n+1}\right)
$$

The condition $a_{n+1}=a_{n}-2 b_{n}$ implies $b_{n}=\frac{1}{2}\left(a_{n}-a_{n+1}\right)=\frac{1}{2}\left((-1)^{n}-3^{n}\right)$.

In conclusion, $A^{2021}=\left(\begin{array}{cc}\frac{1}{2}\left(3^{2021}-1\right) & -\frac{1}{2}\left(3^{2021}+1\right) \\ -\frac{1}{2}\left(3^{2021}+1\right) & \frac{1}{2}\left(3^{2021}-1\right)\end{array}\right)$.