OFFSET
1,1
COMMENTS
The first odd number in the sequence whose square is not in the sequence is 40487.
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
a(3)=7 is included because the least primitive root mod 7 is 3, an odd prime.
8 is not included because there is no primitive root mod 8 (the multiplicative group mod 8 is not cyclic).
9 is not included because the least primitive root mod 9 is 2.
MAPLE
filter:= proc(n) local p;
p:= numtheory:-primroot(n);
if p = FAIL then return false fi;
p>2 and isprime(p)
end proc:
select(filter, [$1..1000]);
MATHEMATICA
Select[Range@ 263, If[# == {}, False, And[PrimeQ@ #, # > 2] &@ #[[1]] ] &@ PrimitiveRootList[#] &] (* Michael De Vlieger, Aug 02 2018 *)
PROG
(PARI) isok(n) = my(r=lift(znprimroot(prime(n)))); isprime(r) && (r%2); \\ Michel Marcus, Aug 04 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Robert Israel, Aug 02 2018
STATUS
approved