Example of computing powers of the transition matrix
Suppose we have the transition matrix $$ \begin{align*} P = \pmat{0 & 1 & 0 \\ 0 & \frac{1}{2} & \frac{1}{2} \\ \frac{1}{2} & 0 & \frac{1}{2}}. \end{align*} $$ The eigenvalues are $1, i/2, -i/2$, so we have $$ \begin{align*} p_{11}(n) = a_1 + a_2\left(\frac{1}{2}\right)^n \cos \frac{n\pi}{2} + a_3 \left(\frac{1}{2}\right)^n \sin \frac{n\pi}{2}. \end{align*} $$
From how the Markov chain behaves, we know $p_{11}(0) = 1$, $p_{11}(1) = 0$, $p_{11}(2) = 0$, so solving $$ \begin{align*} \begin{cases} 1 &= a_1 + a_2, \\ 0 &= a_1 + \frac{1}{2}a_3, \\ 0 &= a_1 - \frac{1}{4}a_2 \end{cases} \end{align*} $$ yields $a_1 = \frac{1}{5}, a_2 = \frac{4}{5}, a_3 = -\frac{2}{5}$. Therefore $$ \begin{align*} p_{11}(n) &= \frac{1}{5} + \left(\frac{1}{2}\right)^n\left(\frac{4}{5}\cos \frac{n\pi}{2} - \frac{2}{5}\sin \frac{n\pi}{2}\right) \\ &\to \frac{1}{5} \text{ as } n\to \infty \end{align*} $$ which makes sense since we expect we spend less than a third of the time at state 1.