Let $F$ be a finite field of order $p$, where $p$ is prime. For any $n\times n$ matrix $A$ that is invertible over $F$, then there would appear to exist integers $k$ such that $A^{k} = I$. My question is simply what is the minimum value of $k$ (as a function of $n$ and $p$), which I will call $k_{n,p}$, such that this relation holds for all choices of $A$.
Proving that such an integer exists is relatively straightforward. By assumption, there exists a $B$ such that $AB = I$. Furthermore, there are precisely $\gamma_{n}(p) = (p^n - 1)(p^n-p) \ldots (p^n - p^{n-1})$ matrices satisfying the requirements for $A$. Since invertible matrices form a group, this implies that there exist distinct integers $a$ and $b$ between $1$ and $\gamma_{n}(p)+1$ such that $A^a = A^b$, and hence $B = A^{a-b-1} = A^{k-1}$. This implies that $k_{n,p} \leq \gamma_n(p)$. Furthermore, since the order of the group of invertible matrices over $F$ is $\gamma_n(p)$, and the powers of $A$ form a subgroup of this group, Lagrange's theorem implies that $k_{n,p}$ must divide $\gamma_n(p)$. So my question amounts to whether $k_{n,p} = \gamma_n(p)$, or whether you can do better.
This would essentially be an equivalent of Fermat's little theorem for matrices, but in searching such literature I have only been able to turn up trace relations, and so if this is well known, or if my reasoning is flawed, I would appreciate a pointer to the relevant literature (or to my error).