[go: up one dir, main page]

login
A345957
Number of divisors of n with exactly half as many prime factors as n, counting multiplicity.
22
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, 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, 2, 0, 0, 0, 0, 2, 0, 0, 2, 0, 0, 0, 1, 2, 0, 4, 2, 2, 2
OFFSET
1,6
COMMENTS
These divisors do not necessarily include the central divisors (A207375), and may not themselves be central.
EXAMPLE
The a(n) divisors for selected n:
n = 1: 6: 36: 60: 210: 840: 900: 1260: 1296: 3600:
--------------------------------------------------------
1 2 4 4 6 8 12 12 16 16
3 6 6 10 12 18 18 24 24
9 10 14 20 20 20 36 36
15 15 28 30 28 54 40
21 30 45 30 81 60
35 42 50 42 90
70 75 45 100
105 63 150
70 225
105
MATHEMATICA
Table[Length[Select[Divisors[n], PrimeOmega[#]==PrimeOmega[n]/2&]], {n, 100}]
PROG
(PARI) a(n) = my(nb=bigomega(n)); sumdiv(n, d, 2*bigomega(d) == nb); \\ Michel Marcus, Aug 16 2021
(Python)
from sympy import divisors, factorint
def a(n):
npf = len(factorint(n, multiple=True))
divs = divisors(n)
return sum(2*len(factorint(d, multiple=True)) == npf for d in divs)
print([a(n) for n in range(1, 88)]) # Michael S. Branicky, Aug 17 2021
(Python 3.8+)
from itertools import combinations
from math import prod, comb
from sympy import factorint
def A345957(n):
if n == 1:
return 1
fs = factorint(n)
elist = list(fs.values())
q, r = divmod(sum(elist), 2)
k = len(elist)
if r:
return 0
c = 0
for i in range(k+1):
m = (-1)**i
for d in combinations(range(k), i):
t = k+q-sum(elist[j] for j in d)-i-1
if t >= 0:
c += m*comb(t, k-1)
return c # Chai Wah Wu, Aug 20 2021
(Python)
from sympy import factorint
from sympy.utilities.iterables import multiset_combinations
def A345957(n):
if n == 1:
return 1
fs = factorint(n, multiple=True)
q, r = divmod(len(fs), 2)
return 0 if r else len(list(multiset_combinations(fs, q))) # Chai Wah Wu, Aug 20 2021
CROSSREFS
The case of powers of 2 is A000035.
Positions of even terms are A000037.
Positions of odd terms are A000290.
Positions of 0's are A026424.
Positions of 1's are A056798.
The rounded version is A096825.
The case of all divisors (not just 2) is A347042.
The smallest of these divisors is A347045 (rounded: A347043).
The greatest of these divisors is A347046 (rounded: A347044).
A000005 counts divisors.
A001221 counts distinct prime factors.
A001222 counts all prime factors.
A056239 adds up prime indices, row sums of A112798.
A207375 lists central divisors.
A325534 counts separable partitions, ranked by A335433.
A325535 counts inseparable partitions, ranked by A335448.
A334997 counts chains of divisors of n by length.
Sequence in context: A308183 A346632 A230595 * A325189 A357637 A130731
KEYWORD
nonn
AUTHOR
Gus Wiseman, Aug 16 2021
STATUS
approved