A298735 Number of odd squares dividing n.
1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1, 1, 1
Offset: 1
Examples
a(81) = 3 because 81 has 5 divisors {1, 3, 9, 27, 81} among which 3 are odd squares {1, 9, 81}.
Links
- Antti Karttunen, Table of n, a(n) for n = 1..65537
Crossrefs
Programs
-
Mathematica
nmax = 105; Rest[CoefficientList[Series[Sum[x^(2 k - 1)^2/(1 - x^(2 k - 1)^2), {k, 1, nmax}], {x, 0, nmax}], x]] a[n_] := Length[Select[Divisors[n], IntegerQ[Sqrt[#]] && OddQ[#] &]]; Table[a[n], {n, 1, 105}] f[2, e_] := 1; f[p_, e_] := Floor[e/2] + 1; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Sep 11 2020 *)
-
PARI
a(n)=factorback(apply(e->e\2+1, factor(n/2^valuation(n,2))[, 2])) \\ Rémy Sigrist, Jan 26 2018
Formula
G.f.: Sum_{k>=1} x^((2*k-1)^2)/(1 - x^((2*k-1)^2)).
Multiplicative with a(2^e) = 1 and a(p^e) = floor(e/2) + 1 for p > 2. - Amiram Eldar, Sep 11 2020
Asymptotic mean: lim_{m->oo} (1/m) * Sum_{k=1..m} a(k) = Pi^2/8 (A111003). - Amiram Eldar, Sep 25 2022
Extensions
Keyword mult added by Rémy Sigrist, Jan 26 2018
Comments