login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A120630
Dirichlet inverse of A002654.
2
1, -1, 0, 0, -2, 0, 0, 0, -1, 2, 0, 0, -2, 0, 0, 0, -2, 1, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, -2, 0, 0, 0, 0, 2, 0, 0, -2, 0, 0, 0, -2, 0, 0, 0, 2, 0, 0, 0, -1, -1, 0, 0, -2, 0, 0, 0, 0, 2, 0, 0, -2, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, -2, 2, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 4, 0, 0, 0, -2, -2, 0, 0, 0, 0, 0, 0, -2, 1, 0, 0, -2, 0, 0, 0, 0, 2, 0, 0, -2, 0, 0, 0, -2, 0, 0, 0, 2, 0, 0
OFFSET
1,5
LINKS
FORMULA
Multiplicative function with a(p^e)=0 if e>2. a(2)=-1, a(4)=0. If p is a prime congruent to 3 modulo 4, then a(p)=0 and a(p^2)=-1. If p is a prime congruent to 1 modulo 4, then a(p)=-2 and a(p^2)=1.
Sum_{k=1..n} abs(a(k)) ~ c * n, where c = 3/(2*Pi*G) = 0.521269..., and G is Catalan's constant (A006752). - Amiram Eldar, Jan 22 2024
EXAMPLE
a(65)=4 because 65 is 5 times 13 and both of those primes are congruent to 1 modulo 4. Doubling an odd index yields the opposite of the value (e.g., a(130)=-4) because a(2)=-1. Doubling an even index yields zero.
MAPLE
A120630 := proc(n)
local a, pp;
if n = 1 then
1;
else
a := 1 ;
for pp in ifactors(n)[2] do
if op(2, pp) > 2 then
a := 0;
elif op(1, pp) = 2 then
if op(2, pp) = 1 then
a := -a ;
else
a := 0 ;
end if;
elif modp(op(1, pp), 4) = 3 then
if op(2, pp) = 1 then
a := 0 ;
else
a := -a ;
end if;
else
if op(2, pp) = 1 then
a := -2*a ;
else
;
end if;
end if;
end do:
a;
end if;
end proc: # R. J. Mathar, Sep 15 2015
MATHEMATICA
A120630[n_] := Module[{a, pp}, If[n == 1, 1, a = 1; Do[Which[pp[[2]] > 2, a = 0, pp[[1]] == 2, If[pp[[2]] == 1, a = -a, a = 0], Mod[pp[[1]], 4] == 3, If[pp[[2]] == 1, a = 0, a = -a], True, If[pp[[2]] == 1, a = -2*a]], {pp, FactorInteger[n]}]; a]]; Array[A120630, 120] (* Jean-François Alcover, Apr 24 2017, after R. J. Mathar *)
PROG
(PARI) seq(n)={dirdiv(vector(n, n, n==1), vector(n, n, sumdiv( n, d, (d%4==1) - (d%4==3))))} \\ Andrew Howroyd, Aug 05 2018
KEYWORD
mult,easy,sign
AUTHOR
Gerard P. Michon, Jun 25 2006
STATUS
approved