OFFSET
1,5
COMMENTS
Earliest occurrence of k is A018782(k).
LINKS
Jianing Song, Table of n, a(n) for n = 1..10000
FORMULA
Multiplicative with a(p^e) = e + 1 if p == 1 (mod 4), a(p^e) = (1 + (-1)^e)/2 if p = 2 or p == 3 (mod 4).
Dirichlet g.f.: zeta(s)*beta(s)/(1 + 2^(-s)).
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = Pi/6 = 0.523598... (A019673). - Amiram Eldar, Oct 22 2022
MATHEMATICA
f[p_, e_] := If[Mod[p, 4] == 1, e + 1, (1 + (-1)^e)/2]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Oct 22 2022 *)
PROG
(PARI) a(n) = my(r=1, f=factor(n)); for(j=1, #f[, 1], my(p=f[j, 1], e=f[j, 2]); if(p%4==1, r*=e+1, if(e%2, return(0)))); r
CROSSREFS
KEYWORD
nonn,easy,mult
AUTHOR
Jianing Song, Apr 24 2021
STATUS
approved