OFFSET
0,13
COMMENTS
A(n,k) is the number of compositions of n avoiding the pattern {1}^(k+1).
LINKS
Alois P. Heinz, Rows n = 0..140, flattened
FORMULA
A(n,k) = Sum_{i=0..k} A242447(n,i).
EXAMPLE
Square array A(n,k) begins:
1, 1, 1, 1, 1, 1, 1, 1, 1, ...
0, 1, 1, 1, 1, 1, 1, 1, 1, ...
0, 1, 2, 2, 2, 2, 2, 2, 2, ...
0, 3, 3, 4, 4, 4, 4, 4, 4, ...
0, 3, 7, 7, 8, 8, 8, 8, 8, ...
0, 5, 11, 15, 15, 16, 16, 16, 16, ...
0, 11, 21, 26, 31, 31, 32, 32, 32, ...
0, 13, 34, 52, 57, 63, 63, 64, 64, ...
0, 19, 59, 93, 114, 120, 127, 127, 128, ...
MAPLE
b:= proc(n, i, p, k) option remember; `if`(n=0, p!, `if`(i<1, 0,
add(b(n-i*j, i-1, p+j, k)/j!, j=0..min(n/i, k))))
end:
A:= (n, k)-> `if`(k>=n, `if`(n=0, 1, 2^(n-1)), b(n$2, 0, k)):
seq(seq(A(n, d-n), n=0..d), d=0..14);
MATHEMATICA
b[n_, i_, p_, k_] := b[n, i, p, k] = If[n == 0, p!, If[i<1, 0,
Sum[b[n-i*j, i-1, p+j, k]/j!, {j, 0, Min[n/i, k]}]]];
A[n_, k_] := If[k >= n, If[n == 0, 1, 2^(n-1)], b[n, n, 0, k]];
Table[Table[A[n, d-n], {n, 0, d}], {d, 0, 14}] // Flatten (* Jean-François Alcover, Feb 02 2015, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Alois P. Heinz, May 29 2014
STATUS
approved