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.

A114811 Number of real, weakly primitive Dirichlet characters modulo n.

Original entry on oeis.org

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

Views

Author

Steven Finch, Feb 19 2006

Keywords

Comments

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".

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.
		

Crossrefs

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

a(n) = sum A114643(n/d), where the sum is over all divisors 1<=d<=n of A055231(n).
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