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!)
A214269 Number T(n,k) of compositions of n where the difference between largest and smallest parts equals k and adjacent parts are unequal; triangle T(n,k), n>=1, 0<=k<n, read by rows. 18
1, 1, 0, 1, 2, 0, 1, 1, 2, 0, 1, 3, 1, 2, 0, 1, 2, 8, 1, 2, 0, 1, 4, 7, 8, 1, 2, 0, 1, 2, 13, 12, 8, 1, 2, 0, 1, 4, 25, 18, 12, 8, 1, 2, 0, 1, 4, 27, 46, 23, 12, 8, 1, 2, 0, 1, 4, 43, 69, 51, 23, 12, 8, 1, 2, 0, 1, 3, 71, 111, 90, 56, 23, 12, 8, 1, 2, 0 (list; table; graph; refs; listen; history; text; internal format)
OFFSET

1,5

LINKS

Alois P. Heinz, Rows n = 1..150, flattened

FORMULA

T(n,0) = 1, T(n,k) = A214268(n,k) - A214268(n,k-1) for k>0.

EXAMPLE

T(7,0) = 1: [7].

T(7,1) = 4: [4,3], [3,4], [2,3,2], [1,2,1,2,1].

T(7,2) = 7: [3,1,3], [3,1,2,1], [2,1,3,1], [1,3,2,1], [1,3,1,2], [1,2,3,1], [1,2,1,3].

T(7,3) = 8: [5,2], [4,2,1], [4,1,2], [2,5], [2,4,1], [2,1,4], [1,4,2], [1,2,4].

T(7,4) = 1: [1,5,1].

T(7,5) = 2: [6,1], [1,6].

Triangle T(n,k) begins:

  1;

  1,  0;

  1,  2,  0;

  1,  1,  2,  0;

  1,  3,  1,  2,  0;

  1,  2,  8,  1,  2,  0;

  1,  4,  7,  8,  1,  2,  0;

  1,  2, 13, 12,  8,  1,  2,  0;

MAPLE

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

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

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

    end:

A:= proc(n, k) option remember;

      `if`(n=0, 1, add(b(n-j, k+1, j, j, j), j=1..n))

    end:

T:= (n, k)-> A(n, k) -`if`(k=0, 0, A(n, k-1)):

seq(seq(T(n, k), k=0..n-1), n=1..14);

MATHEMATICA

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_] := a[n, k] = If[n == 0, 1, Sum[b[n - j, k+1, j, j, j], {j, 1, n}]]; t[n_, k_] := a[n, k] - If[k == 0, 0, a[n, k-1]]; Table[Table[t[n, k], {k, 0, n-1}], {n, 1, 12}] // Flatten (* Jean-Fran├žois Alcover, Dec 11 2013, translated from Maple *)

CROSSREFS

Columns k=0-10 give: A000012, A214270, A214271, A214272, A214273, A214274, A214275, A214276, A214277, A214278, A214279.

Row sums give: A003242.

Cf. A214246, A214247, A214248, A214249, A214257, A214258, A214268.

Sequence in context: A025871 A051010 A328342 * A130027 A116949 A204427

Adjacent sequences:  A214266 A214267 A214268 * A214270 A214271 A214272

KEYWORD

nonn,tabl

AUTHOR

Alois P. Heinz, Jul 09 2012

STATUS

approved

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 September 22 21:07 EDT 2020. Contains 337291 sequences. (Running on oeis4.)