OFFSET
1,3
COMMENTS
a(n) = 1 if n is of the form 2^p and a(n) = n-1 if n prime.
EXAMPLE
a(18) = 10 because x^18 == 0, 1, 9, 10 (mod 18) => 10 is the greatest residue.
MATHEMATICA
Table[Max[Union[PowerMod[Range[0, n - 1], n, n]]], {n, 100}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Lagneau, Sep 27 2011
STATUS
approved