A342528 Number of compositions with alternating parts weakly decreasing (or weakly increasing).
1, 1, 2, 4, 7, 12, 20, 32, 51, 79, 121, 182, 272, 399, 582, 839, 1200, 1700, 2394, 3342, 4640, 6397, 8771, 11955, 16217, 21878, 29386, 39285, 52301, 69334, 91570, 120465, 157929, 206313, 268644, 348674, 451185, 582074, 748830, 960676, 1229208, 1568716, 1997064
Offset: 0
Keywords
Examples
The a(1) = 1 through a(6) = 20 compositions: (1) (2) (3) (4) (5) (6) (11) (12) (13) (14) (15) (21) (22) (23) (24) (111) (31) (32) (33) (121) (41) (42) (211) (131) (51) (1111) (212) (141) (221) (222) (311) (231) (1211) (312) (2111) (321) (11111) (411) (1212) (1311) (2121) (2211) (3111) (12111) (21111) (111111)
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..1000 (first 501 terms from Andrew Howroyd)
- Gus Wiseman, Sequences counting and ranking partitions and compositions by their differences and quotients.
Crossrefs
Programs
-
Maple
b:= proc(n, i, j) option remember; `if`(n=0, 1, `if`(i<1, 0, b(n, i-1, j)+b(n-i, min(n-i, j), min(n-i, i)))) end: a:= n-> b(n$3): seq(a(n), n=0..42); # Alois P. Heinz, Jan 16 2025
-
Mathematica
Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],GreaterEqual@@Plus@@@Reverse/@Partition[#,2,1]&]],{n,0,15}]
-
PARI
seq(n)={my(p=1/prod(k=1, n, 1-y*x^k + O(x*x^n))); Vec(1+sum(k=1, n, polcoef(p,k,y)*(polcoef(p,k-1,y) + polcoef(p,k,y))))} \\ Andrew Howroyd, Mar 24 2021
Formula
G.f.: Sum_{k>=0} ([y^k] P(x,y))*([y^k] (1 + y)*P(x,y)), where P(x,y) = Product_{k>=1} 1/(1 - y*x^k). - Andrew Howroyd, Jan 16 2025
Extensions
Terms a(21) and beyond from Andrew Howroyd, Mar 24 2021
Comments