I am currently in the process of familiarizing myself with linear algebra, so there may be inaccuracies in my question.
The method of constructing nilpotent matrices is as follows:
- Randomly pick a monic polynomial $f(x)=x^n+a_{n-1}\cdot x^{n-1}+...+a_0$;
- Find the companion matrix $C$ associated with the polynomial $g(x)=f(x)^k$;
- Let the nilpotent matrix $B=f(C)$.
The above inspiration is derived from the answer of this question. I am uncertain whether taking the companion matrix $C$ as the input of $f(x)$ would result in $B^k=0$, due to some related thoerems that I have not yet come across.