OFFSET
1,1
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
EXAMPLE
a(8) = 5 because 19 is the 8th prime, primes 2 and 3 are primitive roots of 19, but 5 is not.
MAPLE
with(numtheory); for n from 1 to 100 do i := 1; while (i < n) and (primroot(ithprime(i) - 1, ithprime(n)) = ithprime(i)) do i := i+1; od; print( ithprime(i)); od:
MATHEMATICA
Flatten[Table[Take[Complement[Prime[Range[25]], PrimitiveRoot[Prime[n]]], 1], {n, 100}]] (* Alonso del Arte, Oct 23 2012 *)
PROG
(PARI) a(n)=my(q=prime(n)); forprime(p=2, q-1, if(znorder(Mod(p, q))<q-1, return(p))); q \\ Charles R Greathouse IV, Oct 26 2012
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Marc LeBrun, Feb 23 2001
EXTENSIONS
Corrected by Jud McCranie, Mar 14 2001. Checked by N. J. A. Sloane Sep 03 2002.
STATUS
approved