login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A261981
Number T(n,k) of compositions of n such that k is the minimal distance between two identical parts; triangle T(n,k), n>=2, 1<=k<=floor((sqrt(8*n-7)-1)/2), read by rows.
6
1, 1, 4, 1, 9, 2, 18, 3, 41, 8, 2, 89, 16, 4, 185, 34, 10, 388, 57, 10, 810, 113, 30, 6, 1670, 213, 52, 12, 3435, 396, 104, 28, 7040, 733, 176, 50, 14360, 1333, 278, 62, 29226, 2419, 512, 152, 24, 59347, 4400, 878, 246, 48, 120229, 7934, 1492, 458, 108
OFFSET
2,3
LINKS
FORMULA
T(n,k) = A261960(n,k-1) - A261960(n,k).
T((n+1)*(n+2)/2+1,n+1) = A000142(n) for n>=0.
EXAMPLE
T(5,1) = 9: 311, 113, 221, 122, 2111, 1211, 1121, 1112, 11111.
T(5,2) = 2: 131, 212.
T(7,2) = 8: 151, 313, 232, 3121, 1213, 2131, 1312, 12121.
T(7,3) = 2: 1231, 1321.
Triangle T(n,k) begins:
n\k: 1 2 3 4 5
---+---------------------------
02 : 1;
03 : 1;
04 : 4, 1;
05 : 9, 2;
06 : 18, 3;
07 : 41, 8, 2;
08 : 89, 16, 4;
09 : 185, 34, 10;
10 : 388, 57, 10;
11 : 810, 113, 30, 6;
12 : 1670, 213, 52, 12;
13 : 3435, 396, 104, 28;
14 : 7040, 733, 176, 50;
15 : 14360, 1333, 278, 62;
16 : 29226, 2419, 512, 152, 24;
MAPLE
b:= proc(n, l) option remember;
`if`(n=0, 1, add(`if`(j in l, 0, b(n-j,
`if`(l=[], [], [subsop(1=NULL, l)[], j]))), j=1..n))
end:
T:= (n, k)-> b(n, [0$(k-1)])-b(n, [0$k]):
seq(seq(T(n, k), k=1..floor((sqrt(8*n-7)-1)/2)), n=2..20);
MATHEMATICA
b[n_, l_] := b[n, l] = If[n == 0, 1, Sum[If[MemberQ[l, j], 0, b[n-j, If[l == {}, {}, Append[Rest[l], j]]]], {j, 1, n}]];
A[n_, k_] := b[n, Array[0&, Min[n, k]]];
T[n_, k_] := A[n, k-1] - A[n, k];
Table[T[n, k], {n, 2, 20}, {k, 1, Floor[(Sqrt[8*n-7]-1)/2]}] // Flatten (* Jean-François Alcover, Apr 13 2017, after Alois P. Heinz *)
CROSSREFS
Columns k=1-2 give: A261983, A261984.
Row sums give A261982.
Sequence in context: A333352 A260253 A376783 * A153265 A331153 A331149
KEYWORD
nonn,tabf
AUTHOR
Alois P. Heinz, Sep 07 2015
STATUS
approved