cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A060503 Primes p that have a primitive root between 0 and p that is not a primitive root of p^2.

This page as a plain text file.
%I A060503 #34 Nov 26 2022 16:56:17
%S A060503 2,29,37,43,71,103,109,113,131,181,191,211,257,263,269,283,349,353,
%T A060503 359,367,373,397,439,449,461,487,509,563,599,617,619,631,641,647,653,
%U A060503 701,739,743,773,797,839,857,863,883,887,907,919,947,971,983,1019,1031
%N A060503 Primes p that have a primitive root between 0 and p that is not a primitive root of p^2.
%C A060503 The smallest primitive roots of p that are not primitive roots of p^2 are in A060504.
%C A060503 Except for the initial term 2, this is a subsequence of A134307. - _Jeppe Stig Nielsen_, Jul 31 2015
%H A060503 Robert Israel, <a href="/A060503/b060503.txt">Table of n, a(n) for n = 1..1000</a>
%e A060503 14 is a primitive root of 29 but not of 29^2, so 29 is a term.
%p A060503 filter:= proc(p) local x;
%p A060503   if not isprime(p) then return false fi;
%p A060503   x:= 0;
%p A060503   do
%p A060503     x:= numtheory:-primroot(x,p);
%p A060503     if x = FAIL then return false fi;
%p A060503     if x &^ (p-1) mod p^2 = 1 then return true fi;
%p A060503   od
%p A060503 end proc:
%p A060503 select(filter, [2, seq(i,i=3..2000,2)]); # _Robert Israel_, Dec 01 2016
%t A060503 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 *)
%o A060503 (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
%Y A060503 Cf. A055578, A060504, A134307.
%K A060503 nonn
%O A060503 1,1
%A A060503 _Jud McCranie_, Mar 22 2001