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.

A128860 Let p be the n-th odd prime; a(n) is the number of primitive roots of p which are relatively prime to p-1.

This page as a plain text file.
%I A128860 #18 Jan 12 2025 17:38:01
%S A128860 0,1,1,1,2,4,1,6,5,3,5,6,3,13,11,10,5,5,10,8,9,16,19,11,16,10,22,13,
%T A128860 23,12,15,30,9,35,8,17,15,46,41,37,14,34,20,36,16,10,21,49,26,54,43,
%U A128860 17,38,64,71,65,23,32,33,22,71,30,56,28,77,16,26,79,38,74
%N A128860 Let p be the n-th odd prime; a(n) is the number of primitive roots of p which are relatively prime to p-1.
%C A128860 The number of primitive roots without the restriction of relative primality is in A008330, so a(n) <= A008330(n+1). A table of prime moduli is in A128250. - _R. J. Mathar_, Oct 31 2007
%D A128860 R. Osborn, Tables of All Primitive Roots of Odd Primes Less Than 1000, Univ. Texas Press, Austin, TX, 1961, pp. 69-70.
%H A128860 T. D. Noe, <a href="/A128860/b128860.txt">Table of n, a(n) for n = 1..1000</a>
%p A128860 A128250 := proc(g,p) local k ; if gcd(g,p) > 1 then RETURN(0) ; fi ; for k from 1 do if (g^k mod p ) = 1 then RETURN(k) ; fi ; od: end: proots := proc(p) local a,g ; a := 0 ; for g from 1 to p do if A128250(g,p) = p-1 and gcd(g,p-1) = 1 then a := a+1 ; fi ; od: RETURN(a) ; end: A128860 := proc(n) local p; p := ithprime(n+1) ; proots(p) ; end: seq(A128860(n),n=1..60) ; # _R. J. Mathar_, Oct 31 2007
%t A128860 a[n_] := Count[PrimitiveRootList[(p = Prime[n+1])], _?(CoprimeQ[#, (p-1)] &)]; Array[a, 70] (* _James C. McMahon_, Jan 12 2025 *)
%K A128860 nonn,easy
%O A128860 1,5
%A A128860 _N. J. A. Sloane_, Apr 20 2007
%E A128860 More terms from _R. J. Mathar_, Oct 31 2007