OFFSET
1,1
COMMENTS
The smallest primitive roots of p that are not primitive roots of p^2 are in A060504.
Except for the initial term 2, this is a subsequence of A134307. - Jeppe Stig Nielsen, Jul 31 2015
LINKS
Robert Israel, Table of n, a(n) for n = 1..1000
EXAMPLE
14 is a primitive root of 29 but not of 29^2, so 29 is a term.
MAPLE
filter:= proc(p) local x;
if not isprime(p) then return false fi;
x:= 0;
do
x:= numtheory:-primroot(x, p);
if x = FAIL then return false fi;
if x &^ (p-1) mod p^2 = 1 then return true fi;
od
end proc:
select(filter, [2, seq(i, i=3..2000, 2)]); # Robert Israel, Dec 01 2016
MATHEMATICA
Reap[For[p = 2, p < 1100, p = NextPrime[p], prp = PrimitiveRootList[p]; prp2 = Select[PrimitiveRootList[p^2], # <= Last[prp]&]; If[AnyTrue[prp, FreeQ[prp2, #]&], Print[p]; Sow[p]]]][[2, 1]] (* Jean-François Alcover, Feb 26 2019 *)
PROG
(PARI) forprime(p=2, , for(a=1, p-1, if(znorder(Mod(a, p))==p-1&Mod(a, p^2)^(p-1)==1, print1(p, ", "); break()))) \\ Jeppe Stig Nielsen, Jul 31 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
Jud McCranie, Mar 22 2001
STATUS
approved