OFFSET
0,2
COMMENTS
If 2n+1 is prime, a(n) = 2n. But there exists nonprime numbers of the form 2n+1 such that a(n) = 2n, for example n = 0, 7, 13, 17, 19, 25, 27, 31, 37, 42, …
LINKS
Amiram Eldar, Table of n, a(n) for n = 0..10000
EXAMPLE
a(10) = 18 because x^10 == 0, 1, 4, 7, 9, 15, 16, 18 (mod 21) => 18 is the greatest residue.
MATHEMATICA
Table[Max[Union[PowerMod[Range[0, 2*n], n, 2*n+1]]], {n, 0, 100}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Lagneau, Oct 20 2011
STATUS
approved