login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A065704
Number of squares or twice squares dividing n.
4
1, 2, 1, 3, 1, 2, 1, 4, 2, 2, 1, 3, 1, 2, 1, 5, 1, 4, 1, 3, 1, 2, 1, 4, 2, 2, 2, 3, 1, 2, 1, 6, 1, 2, 1, 6, 1, 2, 1, 4, 1, 2, 1, 3, 2, 2, 1, 5, 2, 4, 1, 3, 1, 4, 1, 4, 1, 2, 1, 3, 1, 2, 2, 7, 1, 2, 1, 3, 1, 2, 1, 8, 1, 2, 2, 3, 1, 2, 1, 5, 3, 2, 1, 3, 1, 2, 1, 4, 1, 4, 1, 3, 1, 2, 1, 6, 1, 4, 2, 6, 1, 2, 1, 4, 1
OFFSET
1,2
LINKS
FORMULA
a(n) = (1/2)*Sum_{ d divides n } (1-(-1)^sigma(d)).
Multiplicative with a(2^e) = e+1 and a(p^e) = floor(e/2)+1 for an odd prime p.
a(n) = A005361(2*n) for n>0 (conjectured). - Werner Schulte, Jan 15 2018 [This is true only for numbers whose odd part (A000265) is cubefree (A004709). Therefore, the least counterexample is n=3^3=27: a(27) = 2 while A005361(2*27) = 3. - Amiram Eldar, Sep 25 2022]
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = Pi^2/4 (A091476). - Amiram Eldar, Sep 25 2022
EXAMPLE
divisors(36) = {1, 2, 3, 4, 6, 9, 12, 18, 36}, thus a(36) = #{1, 2, 4, 9, 18, 36}=6. a(36) = 1/2*(tau(36)-((-1)^sigma(1)+(-1)^sigma(2)+(-1)^sigma(3)+(-1)^sigma(4)+(-1)^sigma(6)+(-1)^sigma(9)+(-1)^sigma(12)+(-1)^sigma(18)+(-1)^sigma(36))) = 1/2*(9-(-3)) = 6. a(36) = a(2^2*3^2) = a(2^2)*a(3^2) = (2+1)*(1+1) = 6.
MATHEMATICA
f[n_] := Total[1 - (-1)^DivisorSigma[1, Divisors@n]]/2; Array[f, 105] (* Robert G. Wilson v, Jan 02 2013 *)
f[p_, e_] := If[p == 2, e+1, Floor[e/2] + 1]; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Sep 25 2022 *)
PROG
(PARI) a(n) = {my(e = valuation(n, 2), o = n>>e, f = factor(o)); (e+1)*prod(i=1 , #f~, floor(f[i, 2]/2)+1)}; \\ Amiram Eldar, Sep 25 2022
CROSSREFS
KEYWORD
mult,nonn
AUTHOR
Vladeta Jovovic, Dec 04 2001
EXTENSIONS
More terms from David Wasserman, Sep 09 2002
STATUS
approved