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.

A262191 Number T(n,k) of compositions of n such that k is the maximal distance between two identical parts; triangle T(n,k), n>=2, 1<=k<=n-1, read by rows.

This page as a plain text file.
%I A262191 #18 Feb 08 2017 08:57:24
%S A262191 1,0,1,3,1,1,4,4,2,1,5,6,6,3,1,12,13,12,9,4,1,21,23,25,21,13,5,1,36,
%T A262191 42,46,46,34,18,6,1,43,68,88,92,80,52,24,7,1,88,119,152,180,172,132,
%U A262191 76,31,8,1,133,197,267,330,352,304,208,107,39,9,1
%N A262191 Number T(n,k) of compositions of n such that k is the maximal distance between two identical parts; triangle T(n,k), n>=2, 1<=k<=n-1, read by rows.
%H A262191 Alois P. Heinz, <a href="/A262191/b262191.txt">Rows n = 2..20, flattened</a>
%e A262191 T(6,1) = 5: 33, 114, 411, 1122, 2211.
%e A262191 T(6,2) = 6: 141, 222, 1113, 1212, 2121, 3111.
%e A262191 T(6,3) = 6: 1131, 1221, 1311, 2112, 11112, 21111.
%e A262191 T(6,4) = 3: 11121, 11211, 12111.
%e A262191 T(6,5) = 1: 111111.
%e A262191 Triangle T(n,k) begins:
%e A262191 n\k:   1    2    3    4    5    6    7    8   9  10  11
%e A262191 ---+----------------------------------------------------
%e A262191 02 :   1;
%e A262191 03 :   0,   1;
%e A262191 04 :   3,   1,   1;
%e A262191 05 :   4,   4,   2,   1;
%e A262191 06 :   5,   6,   6,   3,   1;
%e A262191 07 :  12,  13,  12,   9,   4,   1;
%e A262191 08 :  21,  23,  25,  21,  13,   5,   1;
%e A262191 09 :  36,  42,  46,  46,  34,  18,   6,   1;
%e A262191 10 :  43,  68,  88,  92,  80,  52,  24,   7,  1;
%e A262191 11 :  88, 119, 152, 180, 172, 132,  76,  31,  8,  1;
%e A262191 12 : 133, 197, 267, 330, 352, 304, 208, 107, 39,  9,  1;
%p A262191 b:= proc(n, s, l) option remember; `if`(n=0, 1, add(
%p A262191       `if`(j in s, 0, b(n-j, s union {`if`(l=[], j, l[1])},
%p A262191       `if`(l=[], [], [subsop(1=NULL, l)[], j]))), j=1..n))
%p A262191     end:
%p A262191 T:= (n, k)-> b(n, {}, [0$k]) -b(n, {}, [0$(k-1)]):
%p A262191 seq(seq(T(n, k), k=1..n-1), n=2..14);
%t A262191 b[n_, s_, l_] := b[n, s, l] = If[n==0, 1, Sum[If[MemberQ[s, j], 0, b[n-j, s ~Union~ {If[l=={}, j, l[[1]]]}, If[l=={}, {}, Append[Rest[l], j]]]], {j, 1, n}]]; T[n_, k_] := b[n, {}, Array[0&, k]] - b[n, {}, Array[0&, k-1]]; Table[T[n, k], {n, 2, 14}, { k, 1, n-1}] // Flatten (* _Jean-François Alcover_, Feb 08 2017, translated from Maple *)
%Y A262191 Column k=1-5 gives A262192, A262194, A262196, A262197, A262200.
%Y A262191 Row sums give A261982.
%Y A262191 Cf. A261981.
%K A262191 nonn,tabl
%O A262191 2,4
%A A262191 _Alois P. Heinz_, Sep 14 2015