OFFSET
1,4
COMMENTS
a(n) = 1 if n prime and a(n) = n-1 if n even.
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..11111
EXAMPLE
a(8) = 7 because x^7 == 0, 1, 3, 5, 7 (mod 8) => 7 is the greatest residue.
MATHEMATICA
Table[Max[PowerMod[Range[0, n-1], n-1, n]], {n, 100}]
PROG
(PARI) A197943(n) = { my(m=0); for(x=0, n-1, m = max(m, lift(Mod(x^(n-1), n)))); (m); }; \\ Antti Karttunen, Sep 10 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Michel Lagneau, Oct 19 2011
EXTENSIONS
More terms added, incorrect PARI-program removed by Antti Karttunen, Sep 10 2018
STATUS
approved