

A107439


a(1)=2, a(n) is the smallest prime > a(n1) such that a(n) is a primitive root mod a(n1) and vice versa.


1



2, 3, 5, 7, 17, 23, 89, 113, 137, 149, 163, 181, 191, 233, 257, 263, 277, 283, 397, 419, 421, 443, 449, 461, 463, 509, 557, 569, 593, 599, 613, 619, 701, 719, 821, 823, 829, 857, 863, 877, 919, 1097, 1103, 1117, 1171, 1181, 1193, 1213, 1237, 1259, 1361, 1367
(list;
graph;
refs;
listen;
history;
text;
internal format)



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



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[x1]+1, , if(znorder(Mod(p, res[x1]))==(res[x1]1) && znorder(Mod(res[x1], p))==(p1), res[x]=p; break()))); res; } \\ Iain Fox, Nov 29 2017


CROSSREFS



KEYWORD

nonn


AUTHOR



STATUS

approved



