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.

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

Original entry on oeis.org

0, 2, 3, 5, 7, 11, 11, 13, 19, 19, 17, 19, 29, 29, 43, 41, 47, 59, 61, 67, 59, 59, 79, 83, 83, 89, 101, 103, 103, 107, 109, 127, 131, 109, 139, 109, 151, 149, 163, 131, 167, 179, 181, 167, 179, 197, 191, 173, 223, 223, 227, 227, 227, 239, 251, 257, 257
Offset: 1

Views

Author

V. Raman, Nov 19 2012

Keywords

Crossrefs

Cf. A002233 (lowest prime primitive root for the n-th prime).
Cf. A001918 (lowest primitive root for the n-th prime).
Cf. A071894 (highest primitive root (less than p) for the n-th prime p).

Programs

  • Maple
    f:=proc(n) local p,k;
       p:= ithprime(n);
       for k from p-1 to 1 by -1 do
         if numtheory:-order(k,p) = p-1 and isprime(k) then return k fi
       od;
    0
    end proc;
    map(f, [$1..100]); # Robert Israel, Apr 11 2021
  • Mathematica
    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 *)
  • 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","))