I was just looking at this question about Fibonacci sequence cycles modulo 5, and I happened to see a very nice solution that involved using matrices. Using the matrix representation of the Fibonacci sequence, one can reduce the problem of finding cycles modulo $n$ to a certain problem concerning matrices. Thus, my question is such:
Given an integer $n$, does there exist an integer $x$ such that \begin{align} \begin{bmatrix} 1 & 1 \\ 1 & 0 \end{bmatrix}^x \equiv \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix} \pmod n \end{align}
Surely there are some values of $n$ that have no associated $x$ satisfying the above equation. In general, what values of $n$ have an associated $x$ that satisfies the above equation. If you haven't looked at the linked answer, my question relates to the Fibonacci sequence in the following way: If there exists an integer $n$ and an integer $x$ that satisfy the equation above, then the fibonacci sequence $ \pmod n$ repeats every $x$ terms. That is, $F_{i}\equiv F_{i+x}\pmod n$
To reiterate, can we characterize those integers $n$ for which there exists an associated integer $x$ that satisfies the matrix equation above?
For $n=5$ we have the $x$ value of 20.
For $n=6$ we have the $x$ value of 24.
I am very interested to know if there are infinitely many solutions like this, or perhaps there is some largest $n$? (I doubt the latter) I am also interested to know what sorts of techniques can be used to solve the above matrix equation. As always, please leave a comment to let me know if I messed something up or was unclear anywhere.