OFFSET
0,3
LINKS
Andrew Howroyd, Table of n, a(n) for n = 0..1000
Mathematics Stack Exchange, What is a sequence run? (answered 2011-12-01)
EXAMPLE
The a(1) = 1 through a(5) = 14 compositions:
(1) (2) (3) (4) (5)
(1,1) (1,2) (1,3) (1,4)
(2,1) (2,2) (2,3)
(1,1,1) (3,1) (3,2)
(1,1,2) (4,1)
(2,1,1) (1,1,3)
(1,1,1,1) (1,2,2)
(2,2,1)
(3,1,1)
(1,1,1,2)
(1,1,2,1)
(1,2,1,1)
(2,1,1,1)
(1,1,1,1,1)
For example, the composition c = (3,1,1,1,1,2,1,1,3,4,1,1) has runs (3), (1,1,1,1), (2), (1,1), (3), (4), (1,1), and since (3) and (1,1) both appear twice, c is not counted under a(20).
MATHEMATICA
Table[Length[Select[Join@@Permutations/@IntegerPartitions[n], UnsameQ@@Split[#]&]], {n, 0, 10}]
PROG
(PARI) \\ here LahI is A111596 as row polynomials.
LahI(n, y) = {sum(k=1, n, y^k*(-1)^(n-k)*(n!/k!)*binomial(n-1, k-1))}
S(n) = {my(p=prod(k=1, n, 1 + y*x^k + O(x*x^n))); 1 + sum(i=1, (sqrtint(8*n+1)-1)\2, polcoef(p, i, y)*LahI(i, y))}
seq(n)={my(q=S(n)); [subst(serlaplace(p), y, 1) | p<-Vec(prod(k=1, n, subst(q + O(x*x^(n\k)), x, x^k)))]} \\ Andrew Howroyd, Feb 12 2022
CROSSREFS
A005811 counts runs in binary expansion.
A011782 counts integer compositions.
A116608 counts compositions by number of distinct parts.
A242882 counts compositions with distinct multiplicities.
A297770 counts distinct runs in binary expansion.
A325545 counts compositions with distinct differences.
A329744 counts compositions by runs-resistance.
A351014 counts distinct runs in standard compositions.
Counting words with all distinct runs:
- A351202 = permutations of prime factors.
KEYWORD
nonn
AUTHOR
Gus Wiseman, Feb 09 2022
EXTENSIONS
Terms a(26) and beyond from Andrew Howroyd, Feb 12 2022
STATUS
approved