OFFSET
1,2
COMMENTS
a(n) is the least number that is a primitive root mod prime(n) but not mod any lower prime.
Using the Chinese Remainder Theorem, it is easy to show that such k always exists.
EXAMPLE
10 is a primitive root mod prime(4) = 7, but not mod 2, 3 or 5. This is the least number with that property, so a(4)=10.
MAPLE
a[1]:= 1: a[2]:= 2: p:= 3:
Cands:= {4, seq(seq(6*i+j, j=[0, 4]), i=1..10^7)}:
for n from 3 while Cands <> {} do
p:= nextprime(p);
r:= numtheory:-primroot(p);
s:= select(t -> igcd(t, p-1)=1, {$1..p-1});
q:= map(t -> r &^t mod p, s);
R, Cands:= selectremove(t -> member(t mod p, q), Cands):
if R = {} then break fi;
a[n]:= min(R);
od:
seq(a[i], i=1..n-1);
CROSSREFS
KEYWORD
nonn
AUTHOR
Robert Israel, Feb 21 2017
STATUS
approved