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.

A345926 Number of distinct possible alternating sums of permutations of the multiset of prime indices of n.

This page as a plain text file.
%I A345926 #17 Aug 23 2021 13:39:00
%S A345926 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,
%T A345926 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,
%U A345926 2,3,1,3,1,2,2,2,2,3,1,2,1,2,1,4,2,2,2,2,1,3,2,2,2,2,2,2,1,2,2,3
%N A345926 Number of distinct possible alternating sums of permutations of the multiset of prime indices of n.
%C A345926 First differs from A096825 at a(90) = 3, A096825(90) = 4.
%C A345926 A prime index of n is a number m such that prime(m) divides n. The multiset of prime indices of n is row n of A112798.
%C A345926 The alternating sum of a sequence (y_1,...,y_k) is Sum_i (-1)^(i-1) y_i. Of course, the alternating sum of prime indices is also the reverse-alternating sum of reversed prime indices.
%C A345926 Also the number of possible values of A056239(d) where d is a divisor of n with half as many prime factors (rounded up) as n.
%e A345926 Grouping the 12 permutations of {1,2,2,3} by alternating sum k gives:
%e A345926   k = -2: (1223) (1322) (2213) (2312)
%e A345926   k =  0: (1232) (2123) (2321) (3212)
%e A345926   k =  2: (2132) (2231) (3122) (3221)
%e A345926 so a(90) = 3.
%t A345926 primeMS[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
%t A345926 ats[y_]:=Sum[(-1)^(i-1)*y[[i]],{i,Length[y]}];
%t A345926 Table[Length[Union[ats/@Permutations[primeMS[n]]]],{n,100}]
%o A345926 (Python)
%o A345926 from sympy import factorint, primepi
%o A345926 from sympy.utilities.iterables import multiset_combinations
%o A345926 def A345926(n):
%o A345926     fs = dict((primepi(a),b) for (a,b) in factorint(n).items())
%o A345926     return len(set(sum(d) for d in multiset_combinations(fs, (sum(fs.values())+1)//2))) # _Chai Wah Wu_, Aug 23 2021
%Y A345926 The version for prime factors instead of indices is A343943.
%Y A345926 A000005 counts divisors.
%Y A345926 A000041 counts partitions of 2n with alternating sum 0, ranked by A000290.
%Y A345926 A001414 adds up prime factors, row sums of A027746.
%Y A345926 A056239 adds up prime indices,  row sums of A112798.
%Y A345926 A097805 counts compositions by alternating (or reverse-alternating) sum.
%Y A345926 A103919 counts partitions by sum and alternating sum (reverse: A344612).
%Y A345926 A316524 gives the alternating sum of prime indices (reverse: A344616).
%Y A345926 A345197 counts compositions by length and alternating sum.
%Y A345926 A344610 counts partitions by sum and positive reverse-alternating sum.
%Y A345926 Cf. A008549, A032443, A083399, A096825, A239830, A344607, A344609, A344651, A345957, A345960, A345961.
%K A345926 nonn
%O A345926 1,6
%A A345926 _Gus Wiseman_, Jul 14 2021