login
By rows, array T(n,k)=number of compositions of n with first part k and no equal adjacent parts.
6

%I #15 May 17 2024 10:20:18

%S 1,0,1,1,1,1,2,0,1,1,2,2,1,1,1,5,4,2,1,1,1,9,5,3,3,1,1,1,14,10,6,3,3,

%T 1,1,1,25,18,12,6,4,3,1,1,1,46,29,20,13,6,4,3,1,1,1,78,53,33,20,13,7,

%U 4,3,1,1,1,136,95,59,36,22,13,7,4,3,1,1,1,242,161,104,65,36,22,14,7,4,3,1,1,1

%N By rows, array T(n,k)=number of compositions of n with first part k and no equal adjacent parts.

%C Row sums are the Carlitz sequence, A003242.

%H Joerg Arndt, <a href="/A096568/b096568.txt">Table of n, a(n) for n = 1..1035</a> (rows 1..45, flattened)

%F Define s(0)=1, T(1, 1)=1 and T(i, j)=0 for j>i. For n>=2 and 1<=k<=n, define s(n)=T(n, 1)+T(n, 2)+...+T(n, n) and T(n, k)=s(n-k)-T(n-k, k).

%F G.f. for column k: C(x)*x^k/(1+x^k) where C(x) is the g.f. for A003242. - _John Tyler Rascoe_, May 16 2024

%e Triangle starts

%e 01: 1,

%e 02: 0, 1,

%e 03: 1, 1, 1,

%e 04: 2, 0, 1, 1,

%e 05: 2, 2, 1, 1, 1,

%e 06: 5, 4, 2, 1, 1, 1,

%e 07: 9, 5, 3, 3, 1, 1, 1,

%e 08: 14, 10, 6, 3, 3, 1, 1, 1,

%e 09: 25, 18, 12, 6, 4, 3, 1, 1, 1,

%e 10: 46, 29, 20, 13, 6, 4, 3, 1, 1, 1,

%e 11: 78, 53, 33, 20, 13, 7, 4, 3, 1, 1, 1,

%e 12: 136, 95, 59, 36, 22, 13, 7, 4, 3, 1, 1, 1,

%e 13: 242, 161, 104, 65, 36, 22, 14, 7, 4, 3, 1, 1, 1,

%e 14: 419, 283, 181, 111, 67, 38, 22, 14, 7, 4, 3, 1, 1, 1,

%e 15: 733, 500, 319, 194, 118, 68, 38, 23, 14, 7, 4, 3, 1, 1, 1,

%e 16: 1291, 869, 557, 342, 201, 120, 70, 38, 23, 14, 7, 4, 3, 1, 1, 1,

%e ...

%e T(6,1)=5 counts the compositions 1+2+1+2, 1+2+3, 1+3+2, 1+4+1, 1+5.

%o (PARI)

%o R=20;

%o M=matrix(R,R);

%o T(n,k) = if (n==0, k==0, if (k==0, n==0, M[n,k] ) );

%o { for (n=1, R,

%o for(k=1, n,

%o M[n,k] = sum(j=0,n, T(n-k, j)) - T(n-k, k);

%o );

%o ); }

%o for (n=1,R,for(k=1,n, print1(M[n,k],", ") ); );

%o \\ _Joerg Arndt_, May 21 2013

%Y Cf. A003242, A096569, A096570, A096571, A096572.

%K nonn,tabl

%O 1,7

%A _Clark Kimberling_, Jun 27 2004

%E Corrected by _Joerg Arndt_, May 21 2013