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 automaton. 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 exponentially 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 $L$ 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 is how the big primes mentioned above can enter the game.

**Update:** Further numerical experiments showed that the smallest orbit happens when $L=2p^m$, in which case $n=2L$, we have simple linear growth. It gets complicated and quickly growing for most other $L$.

The origin of the problem is the following cellular automaton. Consider $L$ variables $s_j\in \mathbb{Z}_p$, with $j=1,2,\dots,L$. We define a dynamics on the model, such that we perform two operations cyclically. In each operation we group two neighbouring variables into a pair, and we alternate the ways how we make the pairing. For each pairing we perform the update $$(s_j,s_{j+1})\to (s_j+s_{j+1},s_j-s_{j+1})$$ What changes is that at every second update $j$ is even or odd. If you represent this linear operation with matrices, you get $A$ and $B$ and we want to iterate the product $M=AB$.