I tried using quadratic residues, but I couldn't get much further in determining what $m$ those are.
Additionally, Fermat's Little Theorem seems to be a special case rather than a general solution.
I tried using quadratic residues, but I couldn't get much further in determining what $m$ those are.
Additionally, Fermat's Little Theorem seems to be a special case rather than a general solution.