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
Andrew Howroyd, Table of n, a(n) for n = 0..500
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
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.
KEYWORD
nonn
AUTHOR
Gus Wiseman, Mar 28 2021
EXTENSIONS
Terms a(24) and beyond from Andrew Howroyd, Apr 16 2021
STATUS
approved