OFFSET
0,11
COMMENTS
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. For example:
- (3,3,2,1,1) has weighted alternating sum 1*3 - 2*3 + 3*2 - 4*1 + 5*1 = 4.
- (1,2,2,3) has weighted alternating sum 1*1 - 2*2 + 3*2 - 4*3 = -9.
EXAMPLE
Triangle begins:
1
1
1 0 0 1
1 0 1 1
2 0 0 1 0 1 1
2 0 1 1 1 1 1
3 0 0 2 0 1 1 2 1 1
3 0 2 2 1 1 2 2 1 1
5 0 0 3 0 2 2 2 1 3 2 1 1
5 0 3 3 2 2 3 2 2 4 2 1 1
7 0 0 5 0 3 3 4 2 4 2 4 4 2 1 1
7 0 5 5 3 3 5 4 3 5 3 5 4 2 1 1
Row n = 6 counts the following partitions:
k=-3 k=0 k=2 k=3 k=4 k=5 k=6
-----------------------------------------------------------
(33) . . (42) . (321) (51) (222) (411) (6)
(2211) (3111) (21111)
(111111)
MATHEMATICA
altwtsum[y_]:=Sum[(-1)^(k-1)*k*y[[k]], {k, 1, Length[y]}];
Table[Length[Select[IntegerPartitions[n], altwtsum[#]==k&]], {n, 0, 15}, {k, Min[altwtsum/@IntegerPartitions[n]], Max[altwtsum/@IntegerPartitions[n]]}]
CROSSREFS
KEYWORD
nonn,tabf
AUTHOR
Gus Wiseman, Jun 15 2023
STATUS
approved