login
Dirichlet inverse of A026741, which is defined as n if n is odd, n/2 if n is even.
4

%I #26 Sep 18 2023 02:02:21

%S 1,-1,-3,-1,-5,3,-7,-1,0,5,-11,3,-13,7,15,-1,-17,0,-19,5,21,11,-23,3,

%T 0,13,0,7,-29,-15,-31,-1,33,17,35,0,-37,19,39,5,-41,-21,-43,11,0,23,

%U -47,3,0,0,51,13,-53,0,55,7,57,29,-59,-15,-61,31,0,-1,65,-33,-67,17,69,-35,-71,0,-73,37,0,19,77,-39,-79

%N Dirichlet inverse of A026741, which is defined as n if n is odd, n/2 if n is even.

%H Antti Karttunen, <a href="/A349341/b349341.txt">Table of n, a(n) for n = 1..20000</a>

%F a(1) = 1; a(n) = -Sum_{d|n, d < n} A026741(n/d) * a(d).

%F a(n) = A349342(n) - A026741(n).

%F a(2n+1) = A349343(2n+1) for all n >= 1.

%F Multiplicative with a(2^e) = -1, a(p) = -p and a(p^e) = 0 if e > 1. - _Sebastian Karlsson_, Nov 15 2021

%t a[1]=1;a[n_]:=-DivisorSum[n,If[OddQ[n/#],n/#,n/(2#)]*a@#&,#<n&];Array[a,79] (* _Giorgos Kalogeropoulos_, Nov 15 2021 *)

%t f[p_, e_] := If[e == 1, -p, 0]; f[2, e_] := -1; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* _Amiram Eldar_, Sep 18 2023 *)

%o (PARI) A349341(n) = { my(f = factor(n)); prod(i=1, #f~, if(2==f[i,1], -1, if(1==f[i,2], -f[i,1], 0))); };

%o (Python)

%o from sympy import prevprime, factorint, prod

%o def f(p, e):

%o return -1 if p == 2 else 0 if e > 1 else -p

%o def a(n):

%o return prod(f(p, e) for p, e in factorint(n).items()) # _Sebastian Karlsson_, Nov 15 2021

%Y Agrees with A349343 on odd numbers.

%Y Cf. A026741, A349342.

%Y Cf. also A328203, A349134, A349344, A349346, A349353.

%K sign,easy,mult

%O 1,3

%A _Antti Karttunen_, Nov 15 2021