login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A239550 Number A(n,k) of compositions of n such that the first part is 1 and the second differences of the parts are in {-k,...,k}; square array A(n,k), n>=0, k>=0, read by antidiagonals. 13

%I

%S 1,1,1,1,1,1,1,1,1,2,1,1,1,2,2,1,1,1,2,3,2,1,1,1,2,4,4,3,1,1,1,2,4,7,

%T 6,2,1,1,1,2,4,7,11,9,2,1,1,1,2,4,8,13,18,13,3,1,1,1,2,4,8,15,23,32,

%U 18,3,1,1,1,2,4,8,15,28,40,53,24,2,1,1,1,2,4,8,16,29,52,73,89,34,3

%N Number A(n,k) of compositions of n such that the first part is 1 and the second differences of the parts are in {-k,...,k}; square array A(n,k), n>=0, k>=0, read by antidiagonals.

%H Alois P. Heinz, <a href="/A239550/b239550.txt">Antidiagonals n = 0..140, flattened</a>

%e A(6,0) = 3: [1,1,1,1,1,1], [1,2,3], [1,5].

%e A(5,1) = 4: [1,1,1,1,1], [1,1,1,2], [1,2,2], [1,4].

%e A(4,2) = 4: [1,1,1,1], [1,1,2], [1,2,1], [1,3].

%e Square array A(n,k) begins:

%e 1, 1, 1, 1, 1, 1, 1, 1, 1, ...

%e 1, 1, 1, 1, 1, 1, 1, 1, 1, ...

%e 1, 1, 1, 1, 1, 1, 1, 1, 1, ...

%e 2, 2, 2, 2, 2, 2, 2, 2, 2, ...

%e 2, 3, 4, 4, 4, 4, 4, 4, 4, ...

%e 2, 4, 7, 7, 8, 8, 8, 8, 8, ...

%e 3, 6, 11, 13, 15, 15, 16, 16, 16, ...

%e 2, 9, 18, 23, 28, 29, 31, 31, 32, ...

%e 2, 13, 32, 40, 52, 56, 60, 61, 63, ...

%p b:= proc(n, i, j, k) option remember; `if`(n=0, 1,

%p `if`(i=0, add(b(n-h, j, h, k), h=1..n), add(

%p b(n-h, j, h, k), h=max(1, 2*j-i-k)..min(n, 2*j-i+k))))

%p end:

%p A:= (n, k)-> `if`(n=0, 1, b(n-1, 0, 1, k)):

%p seq(seq(A(n, d-n), n=0..d), d=0..12);

%t b[n_, i_, j_, k_] := b[n, i, j, k] = If[n == 0, 1, If[i == 0, Sum[b[n-h, j, h, k], {h, 1, n}], Sum[b[n-h, j, h, k], {h, Max[1, 2*j - i - k], Min[n, 2*j - i + k]}]]] ; A[n_, k_] := If[n == 0, 1, b[n-1, 0, 1, k]]; Table[Table[A[n, d-n], {n, 0, d}], {d, 0, 12}] // Flatten (* _Jean-Fran├žois Alcover_, Jan 22 2015, after _Alois P. Heinz_ *)

%Y Columns k=0-10 gives: A129654, A239551, A239552, A239553, A239554, A239555, A239556, A239557, A239558, A239559, A239560.

%Y Main diagonal gives A239561.

%K nonn,tabl

%O 0,10

%A _Alois P. Heinz_, Mar 21 2014

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified February 19 22:36 EST 2020. Contains 332061 sequences. (Running on oeis4.)