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

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A214268 Number A(n,k) of compositions of n where the difference between largest and smallest parts is <= k and adjacent parts are unequal; square array A(n,k), n>=0, k>=0, read by antidiagonals. 8

%I

%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 3,1,1,1,1,3,4,7,11,5,1,1,1,1,3,4,7,12,12,3,1,1,1,1,3,4,7,14,20,16,5,

%U 1,1,1,1,3,4,7,14,21,28,30,5,1

%N Number A(n,k) of compositions of n where the difference between largest and smallest parts is <= k and adjacent parts are unequal; square array A(n,k), n>=0, k>=0, read by antidiagonals.

%H Alois P. Heinz, <a href="/A214268/b214268.txt">Antidiagonals n = 0..140</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 A(7,4) = 21: [7], [5,2], [4,3], [4,2,1], [4,1,2], [3,4], [3,1,3], [3,1,2,1], [2,5], [2,4,1], [2,3,2], [2,1,4], [2,1,3,1], [1,5,1], [1,4,2], [1,3,2,1], [1,3,1,2], [1,2,4], [1,2,3,1], [1,2,1,3], [1,2,1,2,1].

%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, 3, 11, 12, 14, 14, 14, 14, ...

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

%p b:= proc(n, k, s, t, l) option remember;

%p `if`(n<0, 0, `if`(n=0, 1, add(`if`(j=l, 0, b(n-j, k,

%p min(s, j), max(t, j), j)), j=max(1, t-k+1)..s+k-1)))

%p end:

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

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

%t b[n_, k_, s_, t_, l_] := b[n, k, s, t, l] = If[n < 0, 0, If[n == 0, 1, Sum[If[j == l, 0, b[n - j, k, Min[s, j], Max[t, j], j]], {j, Max[1, t - k + 1], s + k - 1}]]]; A[n_, k_] := If[n == 0, 1, Sum[b[n - j, k + 1, j, j, j], {j, 1, n}]]; Table[Table[A [n, d - n], {n, 0, d}], {d, 0, 14}] // Flatten (* _Jean-François Alcover_, Dec 27 2013, translated from Maple *)

%Y Columns k=0, 1 give: A000012, 1+A214270(n).

%Y Main diagonal gives: A003242.

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

%K nonn,tabl

%O 0,14

%A _Alois P. Heinz_, Jul 09 2012

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.

Last modified August 4 09:03 EDT 2020. Contains 336201 sequences. (Running on oeis4.)