login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A214249 Number A(n,k) of compositions of n where differences between neighboring parts are in {-k,...,k} \ {0}; square array A(n,k), n>=0, k>=0, read by antidiagonals. 10

%I #21 Dec 31 2018 07:32:10

%S 1,1,1,1,1,1,1,1,1,1,1,1,1,3,1,1,1,1,3,2,1,1,1,1,3,4,4,1,1,1,1,3,4,5,

%T 5,1,1,1,1,3,4,7,11,5,1,1,1,1,3,4,7,12,14,7,1,1,1,1,3,4,7,14,20,18,10,

%U 1,1,1,1,3,4,7,14,21,30,36,9,1,1,1,1,3,4,7,14,23,36,50,49,14,1

%N Number A(n,k) of compositions of n where differences between neighboring parts are in {-k,...,k} \ {0}; square array A(n,k), n>=0, k>=0, read by antidiagonals.

%H Alois P. Heinz, <a href="/A214249/b214249.txt">Rows n = 0..140, flattened</a>

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

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

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

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

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

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

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

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

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

%e 1, 2, 4, 4, 4, 4, 4, 4, ...

%e 1, 4, 5, 7, 7, 7, 7, 7, ...

%e 1, 5, 11, 12, 14, 14, 14, 14, ...

%e 1, 5, 14, 20, 21, 23, 23, 23, ...

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

%p `if`(n=i, 1, add(b(n-i, i+j, k), j={$-k..k} minus{0})))

%p end:

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

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

%t 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, Range[-k, -1] ~Join~ Range[k]}]]]; A[n_, k_] := If[n == 0, 1, Sum[b[n, j, Min[n, k]], {j, 1, n}]]; Table[Table[A[n, d-n], {n, 0, d}], {d, 0, 15}] // Flatten (* _Jean-François Alcover_, Jan 15 2014, translated from Maple *)

%Y Columns k=0-2 give: A000012, A173258, A214256.

%Y Main diagonal gives: A003242.

%Y Cf. A214246, A214247, A214248, A214257, A214258, A214268, A214269.

%K nonn,tabl

%O 0,14

%A _Alois P. Heinz_, Jul 08 2012

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 03:15 EDT 2024. Contains 371964 sequences. (Running on oeis4.)