Reading about dual numbers, which can be modeled by a matrix $\varepsilon$ such that $\varepsilon^2=0$, I wonder if it could be generalized to something which gives nonzero square, but e.g. a zero after some $n$ repeated squarings. Namely, I'm interested in a matrix model, so that it'd be easy to experiment with.
Do such matrices $M$ exist, that for some integer $n>1$ we had $M^n\ne0$, but $M^{2n}=0$? If yes, how to construct them?
There is an entire class of matrices that have this property. Consider for instance the $ 4 \times 4 $ matrix $$ M = \begin{pmatrix}0 & a & b & c\\0 & 0 & d & e\\0 & 0 & 0 & f\\0 & 0 & 0 &0\end{pmatrix}. $$
Let $ a, d, f \ne 0 $ to simplify the discussion. Then you can work out that $ M^k \ne 0 $ for $ k < 4 $, whereas $ M^4 = 0 $ for any choice of the matrix elements. This can be generalized to square matrices of any given dimension. Such matrices are said to be strictly upper triangular.
Now, I won't claim this is the most general form of a nilpotent matrix, but it's a quite large class to begin with.