OFFSET
0,3
COMMENTS
LINKS
Andrew Howroyd, Table of n, a(n) for n = 0..200
Mathematics Stack Exchange, What is a sequence run? (answered 2011-12-01)
EXAMPLE
The a(1) = 1 through a(3) = 11 patterns:
(1) (1,1) (1,1,1)
(1,2) (1,1,2)
(2,1) (1,2,2)
(1,2,3)
(1,3,2)
(2,1,1)
(2,1,3)
(2,2,1)
(2,3,1)
(3,1,2)
(3,2,1)
The complement for n = 3 counts the two patterns (1,2,1) and (2,1,2).
MATHEMATICA
allnorm[n_]:=If[n<=0, {{}}, Function[s, Array[Count[s, y_/; y<=#]+1&, n]] /@Subsets[Range[n-1]+1]];
Table[Length[Select[Join@@Permutations/@allnorm[n], UnsameQ@@Split[#]&]], {n, 0, 6}]
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))}
R(q)={[subst(serlaplace(p), y, 1) | p<-Vec(q)]}
seq(n)={my(q=S(n)); concat([1], sum(k=1, n, R(q^k-1)*sum(r=k, n, binomial(r, k)*(-1)^(r-k)) ))} \\ Andrew Howroyd, Feb 12 2022
CROSSREFS
The version for run-lengths instead of runs is A351292.
A005811 counts runs in binary expansion.
A032011 counts patterns with distinct multiplicities.
A044813 lists numbers whose binary expansion has distinct run-lengths.
A131689 counts patterns by number of distinct parts.
A297770 counts distinct runs in binary expansion.
Counting words with all distinct runs:
- A351202 = permutations of prime factors.
- A351642 = word structures.
Row sums of A351640.
KEYWORD
nonn
AUTHOR
Gus Wiseman, Feb 09 2022
EXTENSIONS
Terms a(10) and beyond from Andrew Howroyd, Feb 12 2022
STATUS
approved