Computing the matrix powers of a non-diagonalizable matrix Define 
\begin{equation}
A = \begin{pmatrix} \frac{1}{2} &\frac{1}{2} & 0\\ 0& \frac{3}{4} & \frac{1}{4}\\ 0& \frac{1}{4} & \frac{3}{4} \end{pmatrix}.
\end{equation}
Note that the sum of the dimensions of the eigenspaces of $A$ is only two. $A$ is thus not diagonalizable. How can we compute $A^n$?

Note that your matrix $A$ has the generalized eigenvectors
\begin{equation}v_1=\begin{pmatrix}1 \\ 0 \\ 0\end{pmatrix}, v_2=\begin{pmatrix}0 \\ 2 \\ -2\end{pmatrix}, v_3=\begin{pmatrix}0\\ 0 \\ 1\end{pmatrix}.\end{equation}
Thus, by Jordan decomposition, $A=\big(v_1,v_2,v_3\big)J\big(v_1,v_2,v_3\big)^{-1}$, where 
\begin{equation}J=\begin{pmatrix}\frac12 & 1 & 0\\0 & \frac12 & 0\\0 & 0 & 1\end{pmatrix}.\end{equation}
The problem of calculating $A^n$ is thus reduced to calculating $J^n$. Let $a_{ij}^{(n)}$ denote the entry of $J^n$ in the $i$-th row and $j$-th column. 
The product of an arbitrary $3\times3$-matrix with $J$ is given by:
\begin{equation}
\begin{pmatrix}
a&b&c\\d&e&f\\g&h&i
\end{pmatrix} J =
\begin{pmatrix}
\frac a2&a+\frac b2&c\\\frac d2&d+\frac e2&f\\\frac g2&g+\frac h2&i
\end{pmatrix}.
\end{equation}
We can deduce that, for all $n\in\Bbb N$: 
\begin{align}
a_{11}^{(n)}&=a_{22}^{(n)}=\frac1{2^n}, \\a_{21}^{(n)}&=a_{31}^{(n)}=0,\\ 
a_{13}^{(n)}&=a_{23}^{(n)}=a_{32}^{(n)}=0, \\
a_{33}^{(n)}&=1,\\
a_{12}^{(n+1)}&=a_{11}^{(n)}+\frac{a_{12}^{(n)}}2=\frac1{2^n}+\frac{a_{12}^{(n)}}2.
\end{align}
Thus, all $a_{ij}^{(n)}$ are explicitly known except for $a_{12}^{(n)}$. Note that, by the last equation, \begin{equation}a_{12}^{(n+1)}=2^{-n}+\frac{a_{12}^{(n)}}2 = 2^{-n}+2^{-n}+\frac{a_{12}^{(n-1)}}4 = \dots = (n+1)\cdot2^{-n}.\end{equation}
Thus, 
\begin{equation}J^n=\begin{pmatrix}2^{-n}&n\cdot 2^{1-n} & 0\\0 & 2^{-n} & 0\\0 & 0 & 1\end{pmatrix}.\end{equation}
And by some calculations, we find that 
\begin{equation}
A^n=\big(v_1,v_2,v_3\big)J^n\big(v_1,v_2,v_3\big)^{-1}=
\begin{pmatrix}
2^{-n} & n\cdot 2^{-n-1} - 2^{-n-1} + \frac12 & {1-\frac{n+1}{2^n}\over2}\\
0 & {2^{-n}+1\over2} & {1-2^{-n}\over2} \\
0 & {1-2^{-n}\over2} & {2^{-n}+1\over2} 
\end{pmatrix}.
\end{equation}
