cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A065704 Number of squares or twice squares dividing n.

Original entry on oeis.org

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

Views

Author

Vladeta Jovovic, Dec 04 2001

Keywords

Examples

			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.
		

Crossrefs

Programs

  • 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 *)
  • 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

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

Extensions

More terms from David Wasserman, Sep 09 2002