login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A219429 Highest prime primitive root (less than p) for the n-th prime p. (or 0 if none exists). 1

%I #16 Apr 11 2021 22:16:54

%S 0,2,3,5,7,11,11,13,19,19,17,19,29,29,43,41,47,59,61,67,59,59,79,83,

%T 83,89,101,103,103,107,109,127,131,109,139,109,151,149,163,131,167,

%U 179,181,167,179,197,191,173,223,223,227,227,227,239,251,257,257

%N Highest prime primitive root (less than p) for the n-th prime p. (or 0 if none exists).

%H Robert Israel, <a href="/A219429/b219429.txt">Table of n, a(n) for n = 1..10000</a>

%p f:=proc(n) local p,k;

%p p:= ithprime(n);

%p for k from p-1 to 1 by -1 do

%p if numtheory:-order(k,p) = p-1 and isprime(k) then return k fi

%p od;

%p 0

%p end proc;

%p map(f, [$1..100]); # _Robert Israel_, Apr 11 2021

%t Reap[For[p = 2, p<1000, p = NextPrime[p], s = Select[PrimitiveRootList[p], PrimeQ]; Sow[If[s == {}, 0, Last[s]]]]][[2, 1]] (* _Jean-François Alcover_, Sep 03 2016 *)

%o (PARI) forprime(i=2,600,p=0;for(q=1,i-1,if(znorder(Mod(q,i))==eulerphi(i)&&isprime(q),p=q));print1(p","))

%Y Cf. A002233 (lowest prime primitive root for the n-th prime).

%Y Cf. A001918 (lowest primitive root for the n-th prime).

%Y Cf. A071894 (highest primitive root (less than p) for the n-th prime p).

%K nonn

%O 1,2

%A _V. Raman_, Nov 19 2012

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 03:08 EDT 2024. Contains 371918 sequences. (Running on oeis4.)