%I #11 Aug 16 2023 10:59:42
%S 0,1,2,-1,3,0,4,2,-2,1,5,3,6,2,-1,-2,7,1,8,4,0,3,9,-1,-3,4,4,5,10,2,
%T 11,3,1,5,-2,-3,12,6,2,0,13,3,14,6,5,7,15,4,-4,0,3,7,16,0,-1,1,4,8,17,
%U -2,18,9,6,-3,0,4,19,8,5,1,20,2,21,10,3,9,-3,5
%N Weighted alternating sum of the integer partition with Heinz number n.
%C The Heinz number of a partition (y_1,...,y_k) is prime(y_1)*...*prime(y_k). This gives a bijective correspondence between positive integers and integer partitions.
%C We define the weighted alternating sum of a sequence (y_1,...,y_k) to be Sum_{i=1..k} (-1)^(i - 1) * i * y_i.
%e The partition with Heinz number 600 is (3,3,2,1,1,1), with weighted alternating sum 1*3 - 2*3 + 3*2 - 4*1 + 5*1 - 6*1 = -2, so a(600) = -2.
%t prix[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n], {p_,k_}:>Table[PrimePi[p],{k}]]]];
%t altwtsum[y_]:=Sum[(-1)^(k-1)*k*y[[k]],{k,1,Length[y]}];
%t Table[altwtsum[Reverse[prix[n]]],{n,100}]
%Y The non-alternating version is A318283, reverse A304818.
%Y The unweighted version is A344616, reverse A316524.
%Y For multisets instead of partitions we have A363619.
%Y Positions of zeros are A363621, counted by A363532.
%Y The triangle for this rank statistic is A363622, reverse A363623.
%Y The reverse version is A363625, for multisets A363620.
%Y A055396 gives minimum prime index, maximum A061395.
%Y A112798 lists prime indices, length A001222, sum A056239.
%Y A264034 counts partitions by weighted sum, reverse A358194.
%Y A320387 counts multisets by weighted sum, reverse A007294.
%Y A359677 gives zero-based weighted sum of prime indices, reverse A359674.
%Y A363626 counts compositions with reverse-weighted alternating sum 0.
%Y Cf. A046660, A053632, A106529, A124010, A215366, A261079, A358136, A359361, A359755.
%K sign
%O 1,3
%A _Gus Wiseman_, Jun 13 2023