I am give a sequence defined by the relation
$s_{n + 3} = s_{n + 1} + as_{n}$
and need to determine, for which value of $a \in \{0, ... , 9\}$ the period of a sequence in the field $\mathbb{F}_{31}$ is the longest.
From the relation I derived a characteristic polynomial $\varphi(z) = z^3 - z - a$. Since the degree of the polynomial is 3, it's order (and the period of a sequence) must divide $31^3 - 1$. Trying all of divisors by hand seems not right.
Are there any other methods or observations that could be made to simplify the task?