%I #12 Aug 04 2018 02:56:17
%S 4,6,7,10,14,17,18,22,23,26,31,34,38,43,46,47,49,50,54,58,62,71,73,74,
%T 79,82,86,89,94,97,98,103,106,113,118,122,127,134,137,142,146,157,158,
%U 162,166,167,178,191,193,194,199,202,206,214,218,223,226,233,239,241,242,250,254,257,262,263
%N Numbers whose least primitive root is an odd prime.
%C The first odd number in the sequence whose square is not in the sequence is 40487.
%H Robert Israel, <a href="/A317649/b317649.txt">Table of n, a(n) for n = 1..10000</a>
%e a(3)=7 is included because the least primitive root mod 7 is 3, an odd prime.
%e 8 is not included because there is no primitive root mod 8 (the multiplicative group mod 8 is not cyclic).
%e 9 is not included because the least primitive root mod 9 is 2.
%p filter:= proc(n) local p;
%p p:= numtheory:-primroot(n);
%p if p = FAIL then return false fi;
%p p>2 and isprime(p)
%p end proc:
%p select(filter, [$1..1000]);
%t Select[Range@ 263, If[# == {}, False, And[PrimeQ@ #, # > 2] &@ #[[1]] ] &@ PrimitiveRootList[#] &] (* _Michael De Vlieger_, Aug 02 2018 *)
%o (PARI) isok(n) = my(r=lift(znprimroot(prime(n)))); isprime(r) && (r%2); \\ _Michel Marcus_, Aug 04 2018
%Y Subset of A033948.
%Y Cf. A048976.
%K nonn
%O 1,1
%A _Robert Israel_, Aug 02 2018