A114811 Number of real, weakly primitive Dirichlet characters modulo n.
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, 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, 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
Offset: 1
Examples
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.
Links
- Antti Karttunen, Table of n, a(n) for n = 1..65537
- H. Jager, On the number of Dirichlet characters with modulus not exceeding x, Nederl. Akad. Wetensch. Proc. Ser. A 76 = Indag. Math. 35 (1973) 452-455.
Programs
-
Mathematica
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 *) 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 *)
-
PARI
A055231(n) = {my(f=factor(n)); for (k=1, #f~, if (f[k, 2] > 1, f[k, 2] = 0); ); factorback(f); } \\ From A055231 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 A114811(n) = sumdiv(A055231(n),d,A114643(n/d)); \\ Antti Karttunen, Sep 27 2018
-
PARI
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.
Formula
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
Comments