OFFSET
1
COMMENTS
Multiplicative because A359550 is.
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..100000
FORMULA
a(1) = 1, and for n > 1, a(n) = -Sum_{d|n, d<n} A359550(n/d) * a(d).
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
MATHEMATICA
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 *)
PROG
(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.
(Python)
from math import prod
from sympy import factorint
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
CROSSREFS
KEYWORD
sign,mult
AUTHOR
Antti Karttunen, Jan 06 2023
STATUS
approved