OFFSET
1,1
COMMENTS
if a(n) is 3 mod 4, then by quadratic reciprocity, if q is 3 mod 4, then either q is a square mod a(n) or vice versa, so a(n+1) must be 1 mod 4.
LINKS
Iain Fox, Table of n, a(n) for n = 1..10000
EXAMPLE
a(5)=17 because 7 is a primitive root mod 17 and 17 (=3 mod 7) is a primitive root mod 7. Also a(5) is not 11 since 11 has order 3 mod 7, a(5) is not 13 since 13 has order 2 mod 7.
PROG
(PARI) first(n) = { my(res=vector(n)); res[1]=2; for(x=2, n, forprime(p=res[x-1]+1, , if(znorder(Mod(p, res[x-1]))==(res[x-1]-1) && znorder(Mod(res[x-1], p))==(p-1), res[x]=p; break()))); res; } \\ Iain Fox, Nov 29 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
John L. Drost, May 26 2005
STATUS
approved