Solution (source code)

= Solution

If $B^k=0$ with $k\geq1$, put $S=I+B+\cdots+B^{k-1}$. The <matrix geometric series> telescopes on both sides:
$$
(I-B)S=S(I-B)=I-B^k=I.
$$
Thus \b[$I-B$ is nonsingular], and
$$
\boxed{(I-B)^{-1}=\sum_{j=0}^{k-1}B^j.}
$$
This is a finite polynomial identity for a <nilpotent matrix>; no convergence argument or bound $\|B\|<1$ is required.