Consider matrices $M$ of size $L\times L$ over a finite field $\mathbb{Z}_p$, for simplicity focus on $p$ prime. The size $L$ is even. We want to find the order of a specific class of matrices, namely we want to find the smallest non-zero integer $n$ such that $$M^n=1,$$ where 1 is here the identity matrix of size $L\times L$. The matrix $M$ has a specific block structure, which originates from a specific linear cellular automata. We have $$M=AB,$$ where $$A= \begin{pmatrix} 1 & 1 & & && & \\ 1 & -1 && & & & \\ & & 1 & 1 && &\\ & & 1 & -1 && & \\ &&&& \ddots & & \\ & & & &&1 & 1\\ & & & &&1 & -1\\ \end{pmatrix}$$ and $$ B= \begin{pmatrix} -1 && & & && 1&\\ & 1 & 1 && && \\ & 1 & -1 && && \\ &&& \ddots & & & \\ & & &&1 & 1&\\ & & &&1 & -1&\\ 1 && & & && 1\\ \end{pmatrix}$$ You can see $B$ as $CAC^{-1}$ where $C$ is a cyclic shift over $L$ variables. Separately $A$ and $B$ have simple properties, but their alternating product becomes complicated. I did some numerical testing, choosing first $\mathbb{Z}_3$. The interesting thing is (which also motivates me to look deeper into this) that the order $n$ seems to have a complicated behaviour as a function of $L$ and it is not clear to me what is the precise source of this. Sometimes $n$ is very big, seemingly expontentially growing with $L$. For example $n(L=46)=354292=2^2\cdot 23\cdot 3851$. Or $n(L=58)=9565940=2^2\cdot 5\cdot 29\cdot 16493$. But if $n$ is divisible by 6 then we get much lower numbers, $n(60)=120$ for example. I understand that it is natural to see the prime $p$ somehow reflected in the function $n(L)$, but what I don't understand how the big primes mentioned above can enter the game.