Solution (source code)

= Solution

The <Cayley-Hamilton theorem> states that a square <matrix> satisfies its characteristic <polynomial>. If a $2\times2$ <matrix> is diagonalisable, $A=S\operatorname{diag}(\lambda_1,\lambda_2)S^{-1}$; applying $p(t)=(t-\lambda_1)(t-\lambda_2)$ to the diagonal <matrix> gives zero and hence $p(A)=0$.

If $B^k=0$, every <eigenvalue> $\lambda$ satisfies $\lambda^k=0$, so all <eigenvalues> are zero and the characteristic <polynomial> is $t^n$. Cayley--Hamilton then gives $B^n=0$.