<s>[INST] Finding $B_{2\times 2}$ such that $A^{51}=B$ Assuming  $$ A=\left(\begin{matrix}0 & \sqrt{3}\\\sqrt{3}\ &4\end{matrix}\right)$$ how to find B such that $$A^{51}=B$$ 
My attempts: 
if find $P,D$ that $D$ be diagonal matrix $A=P^{-1} DP$ then $$A^{51}=P^{-1} D^{51}P$$  therefore $B=P^{-1} D^{51}P$ but  how to find $D$ and $P$?
Thanks for any hints.
 [/INST] Here's another way.  The generating function of $A^n$ is $$G(t) = \sum_{n=0}^\infty t^n A^n = (I-tA)^{-1} = 
\dfrac{1}{-1+4t+3t^2}  \left( \begin {array}{cc} -1+4\,t&-t\sqrt {3}\\ -t
\sqrt {3}&-1\end {array} \right) 
$$
Now using a partial fraction decomposition
$$
\eqalign{\frac{1}{-1+4t+3t^2} &={\frac {\sqrt {7}}{14(t+2/3-\sqrt {7}/3)}}-{\frac {\sqrt {7
}}{14(t+2/3+\sqrt {7}/3)}}\cr
&= -\frac{\sqrt{7}}{14} \sum_{n=0}^\infty \frac{t^n}{(-2/3 + \sqrt{7}/3)^{n+1}}
+\frac{\sqrt{7}}{14} \sum_{n=0}^\infty \frac{t^n}{(-2/3 - \sqrt{7}/3)^{n+1}}
}$$
Thus with $\alpha = -2/3 + \sqrt{7}/3$ and $\beta = -2/3 - \sqrt{7}/3$,
the coefficient of $t^{51}$ in $G(t)$ is
$$ \dfrac{\sqrt{7}}{14} \left(\frac{-1}{\alpha^{52}} + \frac{1}{\beta^{52}}\right) \pmatrix{-1 & 0\cr 0 & -1\cr} + \dfrac{\sqrt{7}}{14} \left(\frac{-1}{\alpha^{51}} + \frac{1}{\beta^{51}}\right) \pmatrix{4 & -\sqrt{3}\cr -\sqrt{3} & 0\cr}$$
</s>