login
A358839
Dirichlet inverse of A353627, the characteristic function of the squarefree numbers multiplied by binary powers.
11
1, -1, -1, 0, -1, 1, -1, 0, 1, 1, -1, 0, -1, 1, 1, 0, -1, -1, -1, 0, 1, 1, -1, 0, 1, 1, -1, 0, -1, -1, -1, 0, 1, 1, 1, 0, -1, 1, 1, 0, -1, -1, -1, 0, -1, 1, -1, 0, 1, -1, 1, 0, -1, 1, 1, 0, 1, 1, -1, 0, -1, 1, -1, 0, 1, -1, -1, 0, 1, -1, -1, 0, -1, 1, -1, 0, 1, -1, -1, 0, 1, 1, -1, 0, 1, 1, 1, 0, -1, 1, 1, 0, 1, 1, 1, 0, -1, -1, -1, 0, -1, -1, -1, 0, -1
OFFSET
1
COMMENTS
Note the correspondences between four sequences:
A355689 --- abs ---> A353627
^ ^
| |
inv inv
| |
v v
A166486 <--- abs --- A358839 (this sequence)
Here inv means that the sequences are Dirichlet Inverses of each other, and abs means taking absolute values.
LINKS
FORMULA
Multiplicative with a(p^e) = (-1)^e for odd primes p, and a(2^e) = -1 if e = 1, otherwise 0.
For all e >= 0, a(2^e) = A008683(2^e).
For all n >= 0, a(2n+1) = A008836(2n+1).
a(1) = 1, and for n > 1, a(n) = -Sum_{d|n, d<n} A353627(n/d) * a(d).
a(n) = A359370(n) - A359372(n).
Dirichlet g.f.: (1-1/4^s)*zeta(2*s)/zeta(s). - Amiram Eldar, Jan 01 2023
MATHEMATICA
f[p_, e_] := (-1)^e; f[2, e_] := If[e == 1, -1, 0]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Dec 28 2022 *)
PROG
(PARI) A358839(n) = { my(f = factor(n)); prod(k=1, #f~, if(2==f[k, 1], -(1==f[k, 2]), (-1)^f[k, 2])); };
(Python)
from math import prod
from sympy import factorint
def A358839(n): return prod((-1 if e&1 else 1) if p>2 else -int(e==1) for p, e in factorint(n).items()) # Chai Wah Wu, Mar 11 2025
CROSSREFS
Cf. A166486 (absolute values), A353627 (Dirichlet inverse), A355689 (Dirichlet inverse of the absolute values).
Cf. A008586 (after its initial term gives the positions of 0's), A359371 (positive terms), A359373 (negative terms), A359370, A359372.
Cf. also A166698, A359378.
Sequence in context: A371087 A353457 A112299 * A230901 A285671 A267773
KEYWORD
sign,mult,changed
AUTHOR
Antti Karttunen, Dec 23 2022
STATUS
approved