Earlier I was faced with the matrix:
$$A=\begin{bmatrix} \frac{1}{\sqrt{2}} & -\frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}} \end{bmatrix}$$
Which cycles (for lack of a better word) after an 8th power. So for example:
$$A^1=A^9$$
What I'm wondering is whether it is possible for a square matrix of reals to "cycle" in fewer powers than its dimension? For example does there exist a square matrix where
$$M_{18\text{x}18}^1=M^{17}$$ $$\text{or probably a simpler case}$$ $$M_{4\text{x}4}^1=M^3$$
Consider $$A(\theta) = \begin{bmatrix}\cos(\theta) & -\sin(\theta) & 0 & \cdots & 0\\ \sin(\theta) & \cos(\theta) & 0 & \cdots & 0 \\ 0 & 0 & 1 & \cdots & 0 \\ \vdots & \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & 0 & \cdots & 1\end{bmatrix} $$ Then $A(\theta)^n = A(n\theta)$. Now you should be able to generate matrices of any dimension greater than equal to 2, and so that it cycles after whatever power you like.
(Your example is $\theta = \pi/4$.)