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.

A342532 Number of even-length compositions of n with alternating parts distinct.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Mar 28 2021

Keywords

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.

Examples

			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)
		

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.

Programs

  • 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}]
  • 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

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

Extensions

Terms a(24) and beyond from Andrew Howroyd, Apr 16 2021