login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A128906
Difference between the greatest primitive root and the least primitive root of the n-th prime.
1
0, 0, 1, 2, 6, 9, 11, 13, 16, 25, 21, 33, 29, 31, 40, 49, 54, 57, 61, 62, 63, 74, 78, 83, 87, 97, 96, 102, 97, 107, 115, 126, 131, 133, 145, 140, 147, 157, 160, 169, 174, 177, 170, 183, 193, 194, 205, 211, 222, 217, 227, 230, 227, 242, 251, 256, 265, 263, 267, 275, 274
OFFSET
1,4
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..1001 (adapted to offset 1 by Sidney Cadot).
FORMULA
a(n) = A071894(n) - A001918(n).
MATHEMATICA
Table[(k=p-1; While[MultiplicativeOrder[k, p]!=p-1, k--]; k)-PrimitiveRoot@p, {p, Prime@Range@100}] (* Giorgos Kalogeropoulos, Sep 28 2023 *)
PROG
(PARI) a(n)=my(p=prime(n)); forstep(r=p-1, 2, -1, if(znorder(Mod(r, p))==p-1, return(r-lift(znprimroot(p)))));
vector(66, n, a(n)) \\ Joerg Arndt, Sep 29 2023
CROSSREFS
Sequence in context: A066586 A146974 A133160 * A192420 A139639 A187690
KEYWORD
nonn
AUTHOR
Robert G. Wilson v, Apr 21 2007
EXTENSIONS
a(1)=0 inserted by Georg Fischer, Dec 11 2022
STATUS
approved