A350824 Triangle read by rows: T(n,k) is the number of patterns of length n with all distinct run lengths and maximum value k, n >= 0, k = 0..floor(sqrt(8*n+1)-1/2).
1, 0, 1, 0, 1, 0, 1, 4, 0, 1, 4, 0, 1, 8, 0, 1, 20, 36, 0, 1, 24, 36, 0, 1, 36, 72, 0, 1, 52, 108, 0, 1, 112, 576, 576, 0, 1, 128, 612, 576, 0, 1, 200, 1116, 1152, 0, 1, 264, 1584, 1728, 0, 1, 384, 2520, 2880, 0, 1, 700, 8064, 20736, 14400, 0, 1, 868, 9432, 22464, 14400
Offset: 0
Examples
Triangle begins: 1; 0, 1; 0, 1; 0, 1, 4; 0, 1, 4; 0, 1, 8; 0, 1, 20, 36; 0, 1, 24, 36; 0, 1, 36, 72; 0, 1, 52, 108; 0, 1, 112, 576, 576; 0, 1, 128, 612, 576; 0, 1, 200, 1116, 1152; ... The T(5,1) = 1 pattern is 11111. The T(5,2) = 8 patterns are 12222, 11222, 11122, 11112, 21111, 22111, 22211, 22221.
Links
- Andrew Howroyd, Table of n, a(n) for n = 0..958 (rows 0..100)
Programs
-
PARI
P(n) = {Vec(-1 + prod(k=1, n, 1 + y*x^k + O(x*x^n)))} R(u, k) = {k*[subst(serlaplace(p)/y, y, k-1) | p<-u]} T(n)={my(u=P(n), v=concat([1], sum(k=1, n, R(u, k)*sum(r=k, n, y^r*binomial(r, k)*(-1)^(r-k)) ))); [Vecrev(p) | p<-v]} { my(A=T(16)); for(n=1, #A, print(A[n])) }