OFFSET
1
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..100000
FORMULA
Multiplicative with a(2^e) = 1 if e = 2, 0 otherwise, and for odd primes p, a(p^e) = 1 if e = 1, 0 otherwise.
From Amiram Eldar, Jan 11 2023: (Start)
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 5/Pi^2 = 0.506605... .
Dirichlet g.f.: (zeta(s)/zeta(2*s))*(4^s+1)/(4^s+2^s). (End)
MATHEMATICA
f[p_, e_] := If[e == 1, 1, 0]; f[2, e_] := If[e == 2, 1, 0]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Jan 11 2023 *)
PROG
(PARI) A359592(n) = { my(f = factor(n)); prod(k=1, #f~, if(2==f[k, 1], (2==f[k, 2]), (1==f[k, 2]))); };
(Python)
from sympy import mobius
def A359592(n): return (mobius(n)&1)^(0 if n&1 else mobius(n>>1)&1) # Chai Wah Wu, Jan 09 2023
CROSSREFS
KEYWORD
nonn,mult
AUTHOR
Antti Karttunen, Jan 09 2023
STATUS
approved