Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #19 Jan 06 2023 14:34:49
%S 1,-1,-1,1,-1,1,-1,-1,0,1,-1,-1,-1,1,1,1,-1,0,-1,-1,1,1,-1,1,0,1,1,-1,
%T -1,-1,-1,-1,1,1,1,0,-1,1,1,1,-1,-1,-1,-1,0,1,-1,-1,0,0,1,-1,-1,-1,1,
%U 1,1,1,-1,1,-1,1,0,1,1,-1,-1,-1,1,-1,-1,0,-1,1,0,-1,1,-1,-1,-1,-1,1,-1,1,1,1,1,1,-1,0,1,-1,1,1,1,1,-1,0,0,0,-1,-1,-1,1,-1
%N Dirichlet inverse of A359550, which is multiplicative sequence with a(p^e) = 1 if e < p, otherwise 0.
%C Multiplicative because A359550 is.
%H Antti Karttunen, <a href="/A359551/b359551.txt">Table of n, a(n) for n = 1..100000</a>
%F a(1) = 1, and for n > 1, a(n) = -Sum_{d|n, d<n} A359550(n/d) * a(d).
%F Multiplicative with a(p^e) = -1 if e == 1 (mod p), 1 if e == 0 (mod p), and 0 otherwise. - _Amiram Eldar_, Jan 06 2023
%t f[p_, e_] := If[(r = Mod[e, p]) == 1, -1, If[r == 0, 1, 0]]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* _Amiram Eldar_, Jan 06 2023 *)
%o (PARI) A359551(n) = { my(f=factor(n), r); prod(i=1, #f~, r = f[i, 2]%f[i, 1]; if(r>1, 0, (-1)^r)); }; \\ After _Amiram Eldar_'s multiplicative formula and Mathematica-code.
%o (Python)
%o from math import prod
%o from sympy import factorint
%o def A359551(n): return prod(1 if (d:=e%p)==0 else (-1 if d==1 else 0) for p, e in factorint(n).items()) # _Chai Wah Wu_, Jan 06 2023
%Y Cf. A359550.
%Y Cf. also A359432.
%K sign,mult
%O 1
%A _Antti Karttunen_, Jan 06 2023