%I #26 Nov 14 2021 17:13:24
%S 1,-1,-2,0,-3,2,-5,0,0,3,-7,0,-11,5,6,0,-13,0,-17,0,10,7,-19,0,0,11,0,
%T 0,-23,-6,-29,0,14,13,15,0,-31,17,22,0,-37,-10,-41,0,0,19,-43,0,0,0,
%U 26,0,-47,0,21,0,34,23,-53,0,-59,29,0,0,33,-14,-61,0,38,-15,-67,0,-71,31,0,0,35,-22,-73,0,0,37,-79
%N Dirichlet inverse of A064989, where A064989 is multiplicative with a(2^e) = 1 and a(p^e) = prevprime(p)^e for odd primes p.
%H Antti Karttunen, <a href="/A349125/b349125.txt">Table of n, a(n) for n = 1..20000</a>
%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Dirichlet_convolution">Dirichlet convolution</a>
%H <a href="/index/Pri#prime_indices">Index entries for sequences computed from indices in prime factorization</a>
%F a(1) = 1; a(n) = -Sum_{d|n, d < n} A064989(n/d) * a(d).
%F a(n) = A349126(n) - A064989(n).
%F Multiplicative with a(p^e) = 0 if e > 1, -1 if p = 2 and -prevprime(p) otherwise. - _Sebastian Karlsson_, Nov 13 2021
%F a(n) = A008683(n) * A064989(n). [Because A064989 is fully multiplicative. See "Properties" section in the Wikipedia article]
%t f[p_, e_] := If[e == 1, If[p == 2, -1, -NextPrime[p, -1]], 0]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* _Amiram Eldar_, Nov 13 2021 *)
%o (PARI)
%o A064989(n) = { my(f = factor(n)); if((n>1 && f[1, 1]==2), f[1, 2] = 0); for (i=1, #f~, f[i, 1] = precprime(f[i, 1]-1)); factorback(f); };
%o A349125(n) = (moebius(n)*A064989(n));
%o (PARI) A349125(n) = { my(f = factor(n)); prod(i=1, #f~, if(1<f[i,2], 0, if(2==f[i,1], -1, -precprime(f[i,1]-1)))); }; \\ (After Karlsson's multiplicative formula)
%o (Python)
%o from sympy import prevprime, factorint, prod
%o def f(p, e):
%o return 0 if e > 1 else -1 if p == 2 else -prevprime(p)
%o def a(n):
%o return prod(f(p, e) for p, e in factorint(n).items()) # _Sebastian Karlsson_, Nov 13 2021
%Y Cf. A008683, A064989, A151800, A349126, A349127.
%Y Cf. also A055615, A346234, A349134.
%K sign,mult
%O 1,3
%A _Antti Karttunen_, Nov 13 2021