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.

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.

This page as a plain text file.
%I A261981 #20 Apr 13 2017 04:25:36
%S A261981 1,1,4,1,9,2,18,3,41,8,2,89,16,4,185,34,10,388,57,10,810,113,30,6,
%T A261981 1670,213,52,12,3435,396,104,28,7040,733,176,50,14360,1333,278,62,
%U A261981 29226,2419,512,152,24,59347,4400,878,246,48,120229,7934,1492,458,108
%N 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.
%H A261981 Alois P. Heinz, <a href="/A261981/b261981.txt">Rows n = 2..55, flattened</a>
%F A261981 T(n,k) = A261960(n,k-1) - A261960(n,k).
%F A261981 T((n+1)*(n+2)/2+1,n+1) = A000142(n) for n>=0.
%e A261981 T(5,1) = 9: 311, 113, 221, 122, 2111, 1211, 1121, 1112, 11111.
%e A261981 T(5,2) = 2: 131, 212.
%e A261981 T(7,2) = 8: 151, 313, 232, 3121, 1213, 2131, 1312, 12121.
%e A261981 T(7,3) = 2: 1231, 1321.
%e A261981 Triangle T(n,k) begins:
%e A261981 n\k:     1     2    3    4   5
%e A261981 ---+---------------------------
%e A261981 02 :     1;
%e A261981 03 :     1;
%e A261981 04 :     4,    1;
%e A261981 05 :     9,    2;
%e A261981 06 :    18,    3;
%e A261981 07 :    41,    8,   2;
%e A261981 08 :    89,   16,   4;
%e A261981 09 :   185,   34,  10;
%e A261981 10 :   388,   57,  10;
%e A261981 11 :   810,  113,  30,   6;
%e A261981 12 :  1670,  213,  52,  12;
%e A261981 13 :  3435,  396, 104,  28;
%e A261981 14 :  7040,  733, 176,  50;
%e A261981 15 : 14360, 1333, 278,  62;
%e A261981 16 : 29226, 2419, 512, 152, 24;
%p A261981 b:= proc(n, l) option remember;
%p A261981       `if`(n=0, 1, add(`if`(j in l, 0, b(n-j,
%p A261981       `if`(l=[], [], [subsop(1=NULL, l)[], j]))), j=1..n))
%p A261981     end:
%p A261981 T:= (n, k)-> b(n, [0$(k-1)])-b(n, [0$k]):
%p A261981 seq(seq(T(n, k), k=1..floor((sqrt(8*n-7)-1)/2)), n=2..20);
%t A261981 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}]];
%t A261981 A[n_, k_] := b[n, Array[0&, Min[n, k]]];
%t A261981 T[n_, k_] := A[n, k-1] - A[n, k];
%t A261981 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_ *)
%Y A261981 Columns k=1-2 give: A261983, A261984.
%Y A261981 Row sums give A261982.
%Y A261981 Cf. A000142, A261960, A262191.
%K A261981 nonn,tabf
%O A261981 2,3
%A A261981 _Alois P. Heinz_, Sep 07 2015