OFFSET
1,2
COMMENTS
a(n) = 2 if n prime because the residues are 0 and 1 (Fermat's little theorem).
a(n) = n if n = 2p, p prime > 2. But there exists nonprime numbers q such that a(2q) = 2q, for example q = 1, 15, 21, 39,...
EXAMPLE
a(8) = 5 because x^7 == 0, 1, 3, 5, 7 (mod 8) => 5 distinct residues.
MATHEMATICA
Length[Union[#]]& /@ Table[Mod[k^(n-1), n], {n, 74}, {k, n}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Lagneau, Oct 19 2011
STATUS
approved