A375100 Triangle read by rows: T(n,k) is the number of n-color compositions of n with k pairs of adjacent parts that are the same color.
1, 2, 1, 5, 2, 1, 11, 6, 3, 1, 24, 18, 8, 4, 1, 53, 47, 26, 12, 5, 1, 118, 118, 79, 38, 17, 6, 1, 261, 297, 220, 122, 56, 23, 7, 1, 577, 740, 593, 370, 185, 80, 30, 8, 1, 1276, 1816, 1583, 1068, 589, 274, 111, 38, 9, 1, 2823, 4408, 4166, 3008, 1795, 908, 395, 150, 47, 10, 1
Offset: 1
Examples
Triangle begins: k=0 1 2 3 4 5 6 7 8 n=1: 1; n=2: 2, 1; n=3: 5, 2, 1; n=4: 11, 6, 3, 1; n=5: 24, 18, 8, 4, 1; n=6: 53, 47, 26, 12, 5, 1; n=7: 118, 118, 79, 38, 17, 6, 1; n=8: 261, 297, 220, 122, 56, 23, 7, 1; n=9: 577, 740, 593, 370, 185, 80, 30, 8, 1; ... Row n = 3 counts: T(3,0) = 5: (1,2_2), (2_2,1), (3_1), (3_2), (3_3). T(3,1) = 2: (1,2_1), (2_1,1). T(3,2) = 1: (1,1,1).
Programs
-
PARI
T_xy(max_row) = {my(N=max_row+1, x='x+O('x^N), h= 1/(1-sum(i=1,N, x^i/(1-(x^i)*(y-1)-x)))); for(n=1, N-1, print(Vecrev(polcoeff(h, n))))} T_xy(10)
Formula
G.f.: A(x,y) = 1/(1 - Sum_{i>0} (x^i)/(1 - (y-1)*x^i - x)).