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.

A369308 The number of square divisors d of n such that n/d is also a square.

Original entry on oeis.org

1, 0, 0, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0
Offset: 1

Views

Author

Amiram Eldar, Jan 19 2024

Keywords

Crossrefs

Programs

  • Mathematica
    f[p_,e_] := If[OddQ[e], 0, e/2+1]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100]
  • PARI
    a(n) = vecprod(apply(x -> if(x%2, 0, x/2 + 1), factor(n)[,2]));
    
  • Python
    from math import prod
    from sympy import factorint
    def A369308(n): return prod(0 if e&1 else (e>>1)+1 for e in factorint(n).values()) # Chai Wah Wu, Jan 19 2024

Formula

Multiplicative with a(p^e) = 0 is e is odd, and e/2 + 1 if e is even.
a(n) = 0, if n is not a square (A000037), and A000005(sqrt(n)) otherwise.
Dirichlet g.f.: zeta(2*s)^2.
Sum_{k=1..n} a(k) ~ sqrt(n) * (log(n)/2 + 2*gamma - 1), where gamma is Euler's constant (A001620).