A114643 Number of real primitive Dirichlet characters modulo n.
1, 0, 1, 1, 1, 0, 1, 2, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 2, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 2, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 2, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 2, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 2, 1
Offset: 1
Examples
From _Jianing Song_, Feb 27 2019: (Start) For n = 5, the only real primitive Dirichlet characters modulo n is {Kronecker(5,k)} = [0, 1, -1, -1, 1] = A080891, so a(5) = 1. For n = 8, the real primitive Dirichlet characters modulo n are {Kronecker(8,k)} = [0, 1, 0, -1, 0, -1, 0, 1] = A091337 and [0, 1, 0, 1, 0, -1, 0, -1] = A188510, so a(8) = 2. For n = 20, the only real primitive Dirichlet characters modulo n is {Kronecker(-20,k)} = [0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, -1, 0, -1, 0, 0, 0, -1, 0, -1] = A289741, so a(20) = 1. (End)
References
- W. Ellison and F. Ellison, Prime Numbers, Wiley, 1985, pp. 224-226.
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
- Steven R. Finch, Cubic and quartic characters [Broken link]
- Steven R. Finch, Cubic and quartic characters.
- Vaclav Kotesovec, Graph - the asymptotic ratio
- Eric Weisstein's World of Mathematics, Dirichlet L-Series.
- I. J. Zucker and M. M. Robertson, Some properties of Dirichlet L-series, J. Phys. A 9 (1976) 1207-1214.
Crossrefs
Programs
-
Maple
A114643 := proc(n) local a,pf,p,r; a := 1 ; for pf in ifactors(n)[2] do p := op(1,pf); r := op(2,pf); if p = 2 then if r = 1 then a := 0 ; elif r = 2 then ; elif r = 3 then a := a*2 ; elif r >= 4 then a := 0 ; end if; else if r =1 then ; else a := 0 ; end if; end if; end do: a ; end proc: seq(A114643(n),n=1..40) ; # R. J. Mathar, Mar 02 2015 # Alternative: f:= proc(n) local r,v,F; v:= padic:-ordp(n,2); if v = 1 or v >= 4 then return 0 elif v = 3 then r:= 2 else r:= 1 fi; if numtheory:-issqrfree(n/2^v) then r else 0 fi end proc: map(f, [$1..100]); # Robert Israel, Oct 08 2017
-
Mathematica
a[n_] := Sum[ MoebiusMu[n/d] * Sum[ If[ Mod[i^2 - 1, d] == 0, 1, 0], {i, 2, d}], {d, Divisors[n]}]; a[1] = 1; Table[a[n], {n, 1, 105}] (* Jean-François Alcover, Jun 20 2013, after Steven Finch *) f[2, e_] := Which[e == 1, 0, e == 2, 1, e == 3, 2, e >= 4, 0]; f[p_, e_] := If[e == 1, 1, 0]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Sep 16 2020 *)
-
PARI
a(n)=sum(d=1, n, if(n%d==0, moebius(n/d)*sum(i=1, d, if((i^2-1)%d, 0, 1)), 0)) \\ Steven Finch, Jun 09 2009
Formula
This sequence is multiplicative with a(2) = 0, a(4) = 1, a(8) = 2, a(2^r) = 0 for r > 3, a(p) = 1 for prime p > 2 and a(p^r) = 0 for r > 1. - Steven Finch, Mar 08 2006 (With correction by Jianing Song, Jun 28 2018)
Dirichlet g.f.: zeta(s)*(1 + 2^(-2s) + 2^(1-3s))/(zeta(2s)*(1 + 2^(-s))). - R. J. Mathar, Jul 03 2011
Comments