cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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 read by rows.

This page as a plain text file.
%I A214269 #22 Jan 03 2019 18:00:29
%S A214269 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,
%T A214269 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,
%U A214269 12,8,1,2,0,1,3,71,111,90,56,23,12,8,1,2,0
%N 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.
%H A214269 Alois P. Heinz, <a href="/A214269/b214269.txt">Rows n = 1..150, flattened</a>
%F A214269 T(n,0) = 1, T(n,k) = A214268(n,k) - A214268(n,k-1) for k>0.
%e A214269 T(7,0) = 1: [7].
%e A214269 T(7,1) = 4: [4,3], [3,4], [2,3,2], [1,2,1,2,1].
%e A214269 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].
%e A214269 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].
%e A214269 T(7,4) = 1: [1,5,1].
%e A214269 T(7,5) = 2: [6,1], [1,6].
%e A214269 Triangle T(n,k) begins:
%e A214269   1;
%e A214269   1,  0;
%e A214269   1,  2,  0;
%e A214269   1,  1,  2,  0;
%e A214269   1,  3,  1,  2,  0;
%e A214269   1,  2,  8,  1,  2,  0;
%e A214269   1,  4,  7,  8,  1,  2,  0;
%e A214269   1,  2, 13, 12,  8,  1,  2,  0;
%p A214269 b:= proc(n, k, s, t, l) option remember;
%p A214269       `if`(n<0, 0, `if`(n=0, 1, add(`if`(j=l, 0, b(n-j, k,
%p A214269        min(s, j), max(t, j), j)), j=max(1, t-k+1)..s+k-1)))
%p A214269     end:
%p A214269 A:= proc(n, k) option remember;
%p A214269       `if`(n=0, 1, add(b(n-j, k+1, j, j, j), j=1..n))
%p A214269     end:
%p A214269 T:= (n, k)-> A(n, k) -`if`(k=0, 0, A(n, k-1)):
%p A214269 seq(seq(T(n, k), k=0..n-1), n=1..14);
%t A214269 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 *)
%Y A214269 Columns k=0-10 give: A000012, A214270, A214271, A214272, A214273, A214274, A214275, A214276, A214277, A214278, A214279.
%Y A214269 Row sums give: A003242.
%Y A214269 Cf. A214246, A214247, A214248, A214249, A214257, A214258, A214268.
%K A214269 nonn,tabl
%O A214269 1,5
%A A214269 _Alois P. Heinz_, Jul 09 2012