A369308 The number of square divisors d of n such that n/d is also a square.
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
Links
- Amiram Eldar, Table of n, a(n) for n = 1..10000
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