%I #20 Aug 21 2021 13:22:04
%S 1,0,0,1,0,2,0,0,1,2,0,0,0,2,2,1,0,0,0,0,2,2,0,2,1,2,0,0,0,0,0,0,2,2,
%T 2,3,0,2,2,2,0,0,0,0,0,2,0,0,1,0,2,0,0,2,2,2,2,2,0,4,0,2,0,1,2,0,0,0,
%U 2,0,0,0,0,2,0,0,2,0,0,0,1,2,0,4,2,2,2
%N Number of divisors of n with exactly half as many prime factors as n, counting multiplicity.
%C These divisors do not necessarily include the central divisors (A207375), and may not themselves be central.
%e The a(n) divisors for selected n:
%e n = 1: 6: 36: 60: 210: 840: 900: 1260: 1296: 3600:
%e --------------------------------------------------------
%e 1 2 4 4 6 8 12 12 16 16
%e 3 6 6 10 12 18 18 24 24
%e 9 10 14 20 20 20 36 36
%e 15 15 28 30 28 54 40
%e 21 30 45 30 81 60
%e 35 42 50 42 90
%e 70 75 45 100
%e 105 63 150
%e 70 225
%e 105
%t Table[Length[Select[Divisors[n],PrimeOmega[#]==PrimeOmega[n]/2&]],{n,100}]
%o (PARI) a(n) = my(nb=bigomega(n)); sumdiv(n, d, 2*bigomega(d) == nb); \\ _Michel Marcus_, Aug 16 2021
%o (Python)
%o from sympy import divisors, factorint
%o def a(n):
%o npf = len(factorint(n, multiple=True))
%o divs = divisors(n)
%o return sum(2*len(factorint(d, multiple=True)) == npf for d in divs)
%o print([a(n) for n in range(1, 88)]) # _Michael S. Branicky_, Aug 17 2021
%o (Python 3.8+)
%o from itertools import combinations
%o from math import prod, comb
%o from sympy import factorint
%o def A345957(n):
%o if n == 1:
%o return 1
%o fs = factorint(n)
%o elist = list(fs.values())
%o q, r = divmod(sum(elist),2)
%o k = len(elist)
%o if r:
%o return 0
%o c = 0
%o for i in range(k+1):
%o m = (-1)**i
%o for d in combinations(range(k),i):
%o t = k+q-sum(elist[j] for j in d)-i-1
%o if t >= 0:
%o c += m*comb(t,k-1)
%o return c # _Chai Wah Wu_, Aug 20 2021
%o (Python)
%o from sympy import factorint
%o from sympy.utilities.iterables import multiset_combinations
%o def A345957(n):
%o if n == 1:
%o return 1
%o fs = factorint(n,multiple=True)
%o q, r = divmod(len(fs),2)
%o return 0 if r else len(list(multiset_combinations(fs,q))) # _Chai Wah Wu_, Aug 20 2021
%Y The case of powers of 2 is A000035.
%Y Positions of even terms are A000037.
%Y Positions of odd terms are A000290.
%Y Positions of 0's are A026424.
%Y Positions of 1's are A056798.
%Y The rounded version is A096825.
%Y The case of all divisors (not just 2) is A347042.
%Y The smallest of these divisors is A347045 (rounded: A347043).
%Y The greatest of these divisors is A347046 (rounded: A347044).
%Y A000005 counts divisors.
%Y A001221 counts distinct prime factors.
%Y A001222 counts all prime factors.
%Y A056239 adds up prime indices, row sums of A112798.
%Y A207375 lists central divisors.
%Y A325534 counts separable partitions, ranked by A335433.
%Y A325535 counts inseparable partitions, ranked by A335448.
%Y A334997 counts chains of divisors of n by length.
%Y Cf. A001227, A001414, A028260, A033676, A033677, A073093, A074206, A217581, A344653, A346697-A346704.
%K nonn
%O 1,6
%A _Gus Wiseman_, Aug 16 2021