Is there a variant of Euler's theorem for matrices?

327 Views Asked by At

Euler's theorem says that whenever $a$ and $p$ are coprime integers, then

$a^{\phi(p)} \equiv 1 \mod p$

This is particularly useful for evaluating large powers of $a$:

$a^n \ \%\ p = a^{n\ \%\ \phi(p)}\ \%\ p$

So I was wondering if there is an equivalent of this theorem for matrices, i.e. a way to compute

$T^n \ \% \ p$

for a square integer matrix $T$ and a very large $n$?

UPDATE:

I did some experimentation with different matrices and prime moduli, and found that for a given 2x2 matrix $T$ and for sufficiently large prime $p$'s one of the following two rules holds:

$T^{p-1} \equiv I \mod p \qquad \mathrm{or} \qquad T^{p+1} \equiv \det(T)\cdot I \mod p$

The "choice" of rule will depend on $T$ and $p$ -- and generally takes form "first rule when $w(T)$ is a square mod $p$, and second rule otherwise", where $w(T)$ is an unknown (to me) function of $T$. For example, $w([[7,2], [4,3]]) = 3$, $w([[4,8], [1,3]]) = 33$, $w([[11,-1], [1,0]]) = 13$, $w([[5,3], [7,1]]) = 1$? (first rule only), $w([[11,1], [-3,5]]) = 6$, $w([[2,3], [7,1]]) = 85$, etc.

UPDATE2:

It appears that for a square matrix $[[a,b],[c,d]]$ the $w$-value is the square-free part of number $(a-d)^2 + 4bc$.