A343943 Number of distinct possible alternating sums of permutations of the multiset of prime factors of n.
1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 2, 1, 1, 2, 1, 2, 2, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 1, 2, 2, 2, 3, 1, 2, 2, 2, 1, 3, 1, 2, 2, 2, 1, 2, 1, 2, 2, 2, 1, 2, 2, 2, 2, 2, 1, 4, 1, 2, 2, 1, 2, 3, 1, 2, 2, 3, 1, 3, 1, 2, 2, 2, 2, 3, 1, 2, 1, 2, 1, 4, 2, 2, 2
Offset: 1
Keywords
Examples
The divisors of 525 with 2 prime factors are: 15, 21, 25, 35, with prime factors {3,5}, {3,7}, {5,5}, {5,7}, with distinct sums {8,10,12}, so a(525) = 3.
Crossrefs
The half-length submultisets are counted by A114921.
Including all multisets of prime factors gives A305611(n) + 1.
The strict rounded version appears to be counted by A342343.
The version for prime indices instead of prime factors is A345926.
A097805 counts compositions by alternating (or reverse-alternating) sum.
A334968 counts subsequence-sums of standard compositions.
Programs
-
Mathematica
prifac[n_]:=If[n==1,{},Flatten[ConstantArray@@@FactorInteger[n]]]; Table[Length[Union[Total/@Subsets[prifac[n],{Ceiling[PrimeOmega[n]/2]}]]],{n,100}]
-
Python
from sympy import factorint from sympy.utilities.iterables import multiset_combinations def A343943(n): fs = factorint(n) return len(set(sum(d) for d in multiset_combinations(fs,(sum(fs.values())+1)//2))) # Chai Wah Wu, Aug 23 2021
Comments