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.
%I A114811 #18 Jan 11 2023 06:39:47 %S A114811 1,1,2,1,2,2,2,2,0,2,2,2,2,2,4,0,2,0,2,2,4,2,2,4,0,2,0,2,2,4,2,0,4,2, %T A114811 4,0,2,2,4,4,2,4,2,2,0,2,2,0,0,0,4,2,2,0,4,4,4,2,2,4,2,2,0,0,4,4,2,2, %U A114811 4,4,2,0,2,2,0,2,4,4,2,0,0,2,2,4,4,2,4,4,2,0,4,2,4,2,4,0,2,0,0,0,2,4,2,4,8 %N A114811 Number of real, weakly primitive Dirichlet characters modulo n. %C A114811 Any primitive Dirichlet character is weakly primitive (not conversely). Jager uses the phrase "proper character", but this conflicts with other authors (e.g., W. Ellison and F. Ellison, Prime Numbers, Wiley, 1985, p. 224) who use the word "proper" to mean the same as "primitive". %H A114811 Antti Karttunen, <a href="/A114811/b114811.txt">Table of n, a(n) for n = 1..65537</a> %H A114811 H. Jager, <a href="https://core.ac.uk/reader/82504330">On the number of Dirichlet characters with modulus not exceeding x</a>, Nederl. Akad. Wetensch. Proc. Ser. A 76 = Indag. Math. 35 (1973) 452-455. %F A114811 a(n) = sum A114643(n/d), where the sum is over all divisors 1<=d<=n of A055231(n). %F A114811 This sequence is multiplicative with a(2)=1, a(4)=1, a(8)=2, a(2^r)=0 for r>2, a(p)=2 for prime p>2 and a(p^r)=0 for r>1. - _Steven Finch_, Mar 08 2006 %e A114811 The function chi defined on the integers by chi(1)=1, chi(5)=-1 and chi(2)=chi(3)=chi(4)=chi(6)=0 [and extended periodically] is a weakly primitive character mod 6, but not mod 12 or mod 18. In this sense, we eliminate the "overcounting" of real Dirichlet characters in A060594. %t A114811 rad[n_] := Times @@ First /@ FactorInteger[n]; A055231[n_] := Denominator[ n/rad[n]^2 ]; A114643[n_] := Sum[ MoebiusMu[n/d] * Sum[ If[ Mod[i^2 - 1, d] == 0, 1, 0], {i, 2, d}], {d, Divisors[n] } ]; A114643[1] = 1; a[n_] := Sum[ A114643[n/d], {d, Divisors[ A055231[n] ] } ]; Table[a[n], {n, 1, 105}] (* _Jean-François Alcover_, Jun 20 2013 *) %t A114811 f[p_, e_] := 0; f[p_, 1] = 2; f[2, e_] := 0; f[2, 1] = f[2, 2] = 1; f[2, 3] = 2; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* _Amiram Eldar_, Jan 11 2023 *) %o A114811 (PARI) %o A114811 A055231(n) = {my(f=factor(n)); for (k=1, #f~, if (f[k, 2] > 1, f[k, 2] = 0); ); factorback(f); } \\ From A055231 %o A114811 A114643(n) = sum(d=1, n, if(n%d==0, moebius(n/d)*sum(i=1, d, if((i^2-1)%d, 0, 1)), 0)); \\ From A114643 %o A114811 A114811(n) = sumdiv(A055231(n),d,A114643(n/d)); \\ _Antti Karttunen_, Sep 27 2018 %o A114811 (PARI) %o A114811 A114811(n) = { my(f=factor(n)); for(i=1,#f~,if(2==f[i,1],if(f[i,2]<3,f[i,2]=0,if(3==f[i,2],f[i,2]=1,f[i,1]=0)),if(f[i,2]>1,f[i,1]=0,f[i,1]=2))); factorback(f); }; \\ _Antti Karttunen_, Sep 27 2018, after _Steven Finch_'s multiplicative formula. %Y A114811 Cf. A055231, A060594, A114643. %K A114811 nonn,mult %O A114811 1,3 %A A114811 _Steven Finch_, Feb 19 2006