A365331 The number of divisors of the largest square dividing n.
1, 1, 1, 3, 1, 1, 1, 3, 3, 1, 1, 3, 1, 1, 1, 5, 1, 3, 1, 3, 1, 1, 1, 3, 3, 1, 3, 3, 1, 1, 1, 5, 1, 1, 1, 9, 1, 1, 1, 3, 1, 1, 1, 3, 3, 1, 1, 5, 3, 3, 1, 3, 1, 3, 1, 3, 1, 1, 1, 3, 1, 1, 3, 7, 1, 1, 1, 3, 1, 1, 1, 9, 1, 1, 3, 3, 1, 1, 1, 5, 5, 1, 1, 3, 1, 1, 1
Offset: 1
Links
- Amiram Eldar, Table of n, a(n) for n = 1..10000
Programs
-
Maple
a:= n-> mul(2*iquo(i[2], 2)+1, i=ifactors(n)[2]): seq(a(n), n=1..100); # Alois P. Heinz, Sep 01 2023
-
Mathematica
f[p_, e_] := e + 1 - Mod[e, 2]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100]
-
PARI
a(n) = vecprod(apply(x -> x + 1 - x%2, factor(n)[, 2]));
-
PARI
a(n) = numdiv(n/core(n)); \\ Michel Marcus, Sep 02 2023
Formula
a(n) = 1 if and only if n is squarefree (A005117).
Multiplicative with a(p^e) = e + 1 - (e mod 2).
Dirichlet g.f.: zeta(s)*zeta(2*s)^2/zeta(4*s).
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 5/2.
More precise asymptotics: Sum_{k=1..n} a(k) ~ 5*n/2 + 3*zeta(1/2)*sqrt(n)/Pi^2 * (log(n) + 4*gamma - 2 - 24*zeta'(2)/Pi^2 + zeta'(1/2)/zeta(1/2)), where gamma is the Euler-Mascheroni constant A001620. - Vaclav Kotesovec, Sep 02 2023
Comments