login
Triangle: T(n,k) = number of compositions (ordered partitions) of n such that some part is repeated consecutively k times and no part is repeated consecutively more than k times.
10

%I #28 Jun 04 2021 03:17:40

%S 1,1,1,3,0,1,4,3,0,1,7,6,2,0,1,14,10,5,2,0,1,23,23,11,4,2,0,1,39,50,

%T 22,10,4,2,0,1,71,99,48,22,9,4,2,0,1,124,200,105,46,21,9,4,2,0,1,214,

%U 404,223,101,46,20,9,4,2,0,1,378,805,468,218,98,45,20,9,4,2,0,1,661,1599,979,466,213,98,44,20,9,4,2,0,1

%N Triangle: T(n,k) = number of compositions (ordered partitions) of n such that some part is repeated consecutively k times and no part is repeated consecutively more than k times.

%C Cf. A232294 - A128695 = column 3. - _Geoffrey Critzer_, Mar 24 2014

%H Alois P. Heinz, <a href="/A091613/b091613.txt">Rows n = 1..100, flattened</a>

%F G.f. for column k: 1/(1 - Sum_{i>=1} (x^i + x^(2*i) + ... + x^(k*i))/( 1 + x^i + x^(2*i) + ... + x^(k*i)) ) - 1/(1 - Sum_{i>=1} (x^i + x^(2*i) + ... + x^((k-1)*i))/( 1 + x^i + x^(2*i) + ... + x^((k-1)*i))). - _Geoffrey Critzer_, Mar 24 2014

%e Triangle starts:

%e 1;

%e 1, 1;

%e 3, 0, 1;

%e 4, 3, 0, 1;

%e 7, 6, 2, 0, 1;

%e 14, 10, 5, 2, 0, 1;

%e 23, 23, 11, 4, 2, 0, 1;

%e 39, 50, 22, 10, 4, 2, 0, 1;

%e 71, 99, 48, 22, 9, 4, 2, 0, 1;

%e 124, 200, 105, 46, 21, 9, 4, 2, 0, 1;

%e ...

%e In the partition 3+3+2+2+2+1+3+3+1, 2 is repeated consecutively 3 times, no part is repeated consecutively more than 3 times. (3 appears 4 times nonconsecutively.)

%p b:= proc(n, l, k) option remember; `if`(n=0, 1, add(`if`(

%p i=l, 0, add(b(n-i*j, i, k), j=1..min(k, n/i))), i=1..n))

%p end:

%p T:= (n, k)-> b(n, 0, k)-b(n, 0, k-1):

%p seq(seq(T(n, k), k=1..n), n=1..14); # _Alois P. Heinz_, Feb 08 2017

%t nn=15;Table[Take[Drop[Transpose[Map[PadRight[#,nn+1]&,Table[ CoefficientList[Series[1/(1-Sum[Sum[x^(j i),{i,1,k}]/Sum[x^(j i),{i,0,k}],{j,1,nn}])-1/(1-Sum[Sum[x^(j i),{i,1,k-1}]/Sum[x^(j i),{i,0,k-1}],{j,1,nn}]),{x,0,nn}],x],{k,1,nn}]]],1][[n]],n],{n,1,nn}]//Grid

%t (* or *)

%t Needs["Combinatorica`"];Table[Distribution[Map[Max,Map[Length,Map[Split, Level[Map[Permutations,IntegerPartitions[n,n]],{2}]],{2}]],Range[1,n]],{n,1,15}]//Grid (* _Geoffrey Critzer_, Mar 24 2014 *)

%t b[n_, l_, k_] := b[n, l, k] = If[n == 0, 1, Sum[If[i == l, 0,

%t Sum[b[n - i*j, i, k], {j, 1, Min[k, n/i]}]], {i, 1, n}]];

%t T[n_, k_] := b[n, 0, k] - b[n, 0, k - 1];

%t Table[T[n, k], {n, 1, 14}, {k, 1, n}] // Flatten (* _Jean-François Alcover_, Jun 04 2021, after _Alois P. Heinz_ *)

%Y Row sums: A000079(n-1) (2^(n-1)).

%Y Inverse: A091614.

%Y Square: A091615.

%Y Columns 1-6: A003242, A091616, A091617, A091618, A091619, A091620.

%Y Convergent of columns: A034007.

%K nonn,tabl

%O 1,4

%A _Christian G. Bower_, Jan 23 2004