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.

A380594 a(n) is the number of positive integers having 2*n primitive roots.

This page as a plain text file.
%I A380594 #17 Mar 31 2025 23:12:02
%S A380594 6,4,4,6,2,8,0,4,2,2,2,8,0,2,0,4,0,4,0,12,0,2,0,12,0,2,4,0,0,2,0,6,0,
%T A380594 0,0,10,0,0,0,2,2,6,0,4,0,2,0,12,0,2,0,0,0,4,0,6,0,0,0,10,0,0,0,6,2,2,
%U A380594 0,0,0,0,0,16,0,0,0,0,0,2,0,8,4,2,0,6,0
%N A380594 a(n) is the number of positive integers having 2*n primitive roots.
%C A380594 Let [n] be the set {k; A046144(k) = 2*n}; n >= 1, then a(n) = |[n]|.
%C A380594 If 2*n is a term in A378508, [n] is nonempty and a(n) > 0. Otherwise, if 2*n is not in A378508 then there is no number having 2*n primitive roots, so a(n) = 0; see Example, and A380604.
%H A380594 Max Alekseyev, <a href="https://oeis.org/wiki/User:Max_Alekseyev/gpscripts">PARI/GP Scripts for Miscellaneous Math Problems</a> (invphi.gp).
%H A380594 David M. Bressoud, <a href="https://www.davidbressoud.org/books-videos">A Course in Computational Number Theory (web page)</a>, <a href="https://drive.google.com/file/d/1UMesJ93mpdCabQvETMqOBH8eCR4JWA6X/view?usp=sharing">CNT.m</a>, Computational Number Theory Mathematica package.
%F A380594 a(n) <= A378506(2*n), with equality iff n is in A007617.
%e A380594 For n = 1, 2*n = 2 and there are 6 distinct numbers having 2 primitive roots; [2] = {5,7,9,10,14,18}; so a(10) = 6.
%e A380594 For n = 5, 2*n = 10 and there are just 2 distinct numbers having 10 primitive roots; [5] = {23,46}; so a(5) = 2.
%e A380594 For n = 7, 2*n = 14 and there are no numbers having 14 primitive roots, so a(7) = 0.
%e A380594 The sets [n] listed in rows start as follows; length of row n = a(n):
%e A380594   n          [n]                   a(n)
%e A380594   1    {5,7,9,10,14,18}             6;
%e A380594   2    {11,13,22,26}                4;
%e A380594   3    {29,27,30,54}                4;
%e A380594   4    {17,25,31,34,50,62}          6;
%e A380594   5    {23,46}                      2;
%e A380594   6    {29,37,43,49,58,74,86,98}    8;
%e A380594   7    { }                          0;
%e A380594   8    {41,61,82,122}               4;
%e A380594   9    {81,162}                     2;
%e A380594   10   {67,134}                     2;
%e A380594   ...
%t A380594 a[n_] := Count[Join @@ PhiInverse[PhiInverse[2*n]], _?(IntegerQ[PrimitiveRoot[#]] &)]; Array[a, 100] (* _Amiram Eldar_, Jan 27 2025, using David M. Bressoud's CNT.m *)
%o A380594 (PARI) isA033948(n) = {my(f = factor(n)); lcm(znstar(f)[2]) == eulerphi(f);}
%o A380594 a(n) = {my(v = invphi(2*n), w, c = 0); for(i = 1, #v, c += vecsum(apply(x -> isA033948(x), invphi(v[i])))); c;} \\ _Amiram Eldar_, Jan 27 2025, using _Max Alekseyev_'s invphi.gp
%Y A380594 Cf. A046144, A007617, A010554, A033949, A231772, A378506, A378508, A380604.
%K A380594 nonn
%O A380594 1,1
%A A380594 _David James Sycamore_, _Michael De Vlieger_, and _Amiram Eldar_, Jan 27 2025