OFFSET
1,3
LINKS
Joerg Arndt, Table of n, a(n) for n = 1..9592 (terms for all primes < 10^5)
MATHEMATICA
a[n_] := 1 + Max[ Join[{0}, Length/@ Select[ Split@ Differences @ PrimitiveRootList @ Prime @ n, #[[1]] == 1 &]]]; Array[a, 99] (* Giovanni Resta, Aug 17 2015 *)
PROG
(PARI)
consec_pr(p)= \\ max number of consecutive primroots
{
my( v = vector(p-1) );
my (g = znprimroot(p) );
for (j=1, p-1, if (gcd(p-1, j)==1, v[lift(g^j)]=1 ) );
my ( m=0, t=0 );
for (j=1, p-1, if ( v[j]==0, t=0 , t+=1; if ( t>m, m=t ); ); );
return(m);
}
forprime(p=2, 10^3, c=consec_pr(p); print1( c, ", " ); );
CROSSREFS
KEYWORD
nonn
AUTHOR
Joerg Arndt, Aug 17 2015
STATUS
approved