login
A214248
Number A(n,k) of compositions of n where differences between neighboring parts are in {-k,...,k}; square array A(n,k), n>=0, k>=0, read by antidiagonals.
13
1, 1, 1, 1, 1, 2, 1, 1, 2, 2, 1, 1, 2, 4, 3, 1, 1, 2, 4, 6, 2, 1, 1, 2, 4, 8, 11, 4, 1, 1, 2, 4, 8, 14, 17, 2, 1, 1, 2, 4, 8, 16, 27, 29, 4, 1, 1, 2, 4, 8, 16, 30, 49, 47, 3, 1, 1, 2, 4, 8, 16, 32, 59, 92, 78, 4, 1, 1, 2, 4, 8, 16, 32, 62, 113, 170, 130, 2
OFFSET
0,6
LINKS
EXAMPLE
A(3,0) = 2: [3], [1,1,1].
A(4,1) = 6: [4], [2,2], [2,1,1], [1,2,1], [1,1,2], [1,1,1,1].
A(5,2) = 14: [5], [3,2], [3,1,1], [2,3], [2,2,1], [2,1,2], [2,1,1,1], [1,3,1], [1,2,2], [1,2,1,1], [1,1,3], [1,1,2,1], [1,1,1,2], [1,1,1,1,1].
Square array A(n,k) begins:
1, 1, 1, 1, 1, 1, 1, 1, ...
1, 1, 1, 1, 1, 1, 1, 1, ...
2, 2, 2, 2, 2, 2, 2, 2, ...
2, 4, 4, 4, 4, 4, 4, 4, ...
3, 6, 8, 8, 8, 8, 8, 8, ...
2, 11, 14, 16, 16, 16, 16, 16, ...
4, 17, 27, 30, 32, 32, 32, 32, ...
2, 29, 49, 59, 62, 64, 64, 64, ...
MAPLE
b:= proc(n, i, k) option remember;
`if`(n<1 or i<1, 0, `if`(n=i, 1, add(b(n-i, i+j, k), j={$-k..k})))
end:
A:= (n, k)-> `if`(n=0, 1, add(b(n, j, k), j=1..n)):
seq(seq(A(n, d-n), n=0..d), d=0..15);
MATHEMATICA
b[n_, i_, k_] := b[n, i, k] = If[n < 1 || i < 1, 0, If[n == i, 1, Sum[b[n - i, i + j, k], {j, -k, k}]]]; A[n_, k_] := If[n == 0, 1, Sum[b[n, j, k], {j, 1, n}]]; Table[Table[A[n, d - n], {n, 0, d}], {d, 0, 15}] // Flatten (* Jean-François Alcover, Dec 27 2013, translated from Maple *)
CROSSREFS
Columns k=0-2 give: A000005, A034297, A214255.
Main diagonal gives: A011782.
Sequence in context: A099172 A214246 A214257 * A152719 A107044 A141591
KEYWORD
nonn,tabl
AUTHOR
Alois P. Heinz, Jul 08 2012
STATUS
approved