OFFSET
0,3
COMMENTS
A composition of n is a finite sequence of positive integers summing to n.
Also compositions whose run-lengths are weakly decreasing.
LINKS
Andrew Howroyd, Table of n, a(n) for n = 0..1000
EXAMPLE
The a(0) = 1 through a(5) = 12 compositions:
() (1) (2) (3) (4) (5)
(11) (12) (13) (14)
(21) (22) (23)
(111) (31) (32)
(121) (41)
(211) (122)
(1111) (131)
(212)
(311)
(1211)
(2111)
(11111)
For example, the composition (2,3,2,2,1,1,2,2,2) has run-lengths (1,1,2,2,3) so is counted under a(17).
MATHEMATICA
Table[Length[Select[Join@@Permutations/@IntegerPartitions[n], LessEqual@@Length/@Split[#]&]], {n, 0, 10}]
PROG
(PARI)
step(M, m)={my(n=matsize(M)[1]); for(p=m+1, n, my(v=vector((p-1)\m, i, M[p-i*m, i]), s=vecsum(v)); M[p, ]+=vector(#M, i, s-if(i<=#v, v[i]))); M}
seq(n)={my(M=matrix(n+1, n, i, j, i==1)); for(m=1, n, M=step(M, m)); M[1, n]=0; vector(n+1, i, vecsum(M[i, ]))/(n-1)} \\ Andrew Howroyd, Dec 31 2020
CROSSREFS
The version for the compositions themselves (not run-lengths) is A000041.
The case of partitions is A100883.
Permitting the run-lengths to be weakly decreasing also gives A332835.
The complement is counted by A332871.
Unimodal compositions are A001523.
Compositions that are not unimodal are A115981.
Compositions with equal run-lengths are A329738.
Compositions whose run-lengths are unimodal are A332726.
KEYWORD
nonn
AUTHOR
Gus Wiseman, Feb 29 2020
EXTENSIONS
Terms a(21) and beyond from Andrew Howroyd, Dec 30 2020
STATUS
approved