Solution (source code)

= Solution

Write $B=QDQ^{-1}$ with $D$ a <diagonal matrix>. Then $0=B^k=QD^kQ^{-1}$, so each diagonal entry $\lambda_i$ satisfies $\lambda_i^k=0$ and therefore $\lambda_i=0$. Hence $D=0$ and \b[$B=0$]. Conversely the zero <matrix> is diagonalizable and nilpotent. This proves the existing result that <a diagonalizable nilpotent matrix is zero>; nilpotence alone does not imply a zero <matrix>, because nonzero nilpotent Jordan blocks exist.