login
A342532
Number of even-length compositions of n with alternating parts distinct.
6
1, 0, 1, 2, 3, 4, 9, 14, 28, 44, 83, 136, 250, 424, 757, 1310, 2313, 4018, 7081, 12314, 21650, 37786, 66264, 115802, 202950, 354858, 621525, 1087252, 1903668, 3330882, 5831192, 10204250, 17862232, 31260222, 54716913, 95762576, 167614445, 293356422, 513456686
OFFSET
0,4
COMMENTS
These are finite even-length sequences q of positive integers summing to n such that q(i) != q(i+2) for all possible i.
LINKS
FORMULA
G.f.: 1 + Sum_{k>=1} B_k(x)^2 where B_k(x) is the g.f. of column k of A106351. - Andrew Howroyd, Apr 16 2021
EXAMPLE
The a(2) = 1 through a(7) = 14 compositions:
(1,1) (1,2) (1,3) (1,4) (1,5) (1,6)
(2,1) (2,2) (2,3) (2,4) (2,5)
(3,1) (3,2) (3,3) (3,4)
(4,1) (4,2) (4,3)
(5,1) (5,2)
(1,1,2,2) (6,1)
(1,2,2,1) (1,1,2,3)
(2,1,1,2) (1,1,3,2)
(2,2,1,1) (1,2,3,1)
(1,3,2,1)
(2,1,1,3)
(2,3,1,1)
(3,1,1,2)
(3,2,1,1)
MATHEMATICA
qdq[q_]:=And@@Table[q[[i]]!=q[[i+2]], {i, Length[q]-2}];
Table[Length[Select[Join@@Permutations/@Select[IntegerPartitions[n], EvenQ[Length[#]]&], qdq]], {n, 0, 15}]
PROG
(PARI) \\ here gf gives A106351 as g.f.
gf(n, y)={1/(1 - sum(k=1, n, (-1)^(k+1)*x^k*y^k/(1-x^k) + O(x*x^n)))}
seq(n)={my(p=gf(n, y)); Vec(sum(k=0, n\2, polcoef(p, k, y)^2))} \\ Andrew Howroyd, Apr 16 2021
CROSSREFS
The strictly decreasing version appears to be A064428 (odd-length: A001522).
The equal version is A065608 (A342527 with odds).
The weakly decreasing version is A114921 (A342528 with odds).
Including odds gives A224958.
A000726 counts partitions with alternating parts unequal.
A325545 counts compositions with distinct first differences.
A342529 counts compositions with distinct first quotients.
Sequence in context: A082981 A217787 A077906 * A133993 A341824 A122974
KEYWORD
nonn
AUTHOR
Gus Wiseman, Mar 28 2021
EXTENSIONS
Terms a(24) and beyond from Andrew Howroyd, Apr 16 2021
STATUS
approved