login
A359551
Dirichlet inverse of A359550, which is multiplicative sequence with a(p^e) = 1 if e < p, otherwise 0.
3
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, -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, 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
OFFSET
1
COMMENTS
Multiplicative because A359550 is.
LINKS
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
Cf. A359550.
Cf. also A359432.
Sequence in context: A355689 A353627 A353628 * A353458 A110242 A356315
KEYWORD
sign,mult
AUTHOR
Antti Karttunen, Jan 06 2023
STATUS
approved