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.

A128906 Difference between the greatest primitive root and the least primitive root of the n-th prime.

This page as a plain text file.
%I A128906 #34 Oct 22 2023 15:44:19
%S A128906 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,
%T A128906 97,96,102,97,107,115,126,131,133,145,140,147,157,160,169,174,177,170,
%U A128906 183,193,194,205,211,222,217,227,230,227,242,251,256,265,263,267,275,274
%N A128906 Difference between the greatest primitive root and the least primitive root of the n-th prime.
%H A128906 Amiram Eldar, <a href="/A128906/b128906.txt">Table of n, a(n) for n = 1..1001</a> (adapted to offset 1 by Sidney Cadot).
%F A128906 a(n) = A071894(n) - A001918(n).
%t A128906 Table[(k=p-1;While[MultiplicativeOrder[k,p]!=p-1,k--];k)-PrimitiveRoot@p,{p, Prime@Range@100}] (* _Giorgos Kalogeropoulos_, Sep 28 2023 *)
%o A128906 (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)))));
%o A128906 vector(66,n,a(n)) \\ _Joerg Arndt_, Sep 29 2023
%Y A128906 Cf. A001918, A071894.
%K A128906 nonn
%O A128906 1,4
%A A128906 _Robert G. Wilson v_, Apr 21 2007
%E A128906 a(1)=0 inserted by _Georg Fischer_, Dec 11 2022