A374925
Number of n-color compositions of n having at least one pair of adjacent parts that are the same color.
Original entry on oeis.org
0, 0, 1, 3, 10, 31, 91, 259, 726, 2007, 5489, 14888, 40122, 107574, 287239, 764405, 2028679, 5371858, 14198008, 37467982, 98749767, 259984452, 683865318, 1797500121, 4721662597, 12396308875, 32531025970, 85337831350, 223794544179, 586736215856, 1537941527011
Offset: 0
a(4) = 10 counts: (1,1,1,1), (1,1,2_a), (1,1,2_b), (1,2_a,1), (1,3_a), (2_a,1,1), (2_a,2_a), (2_b,1,1), (2_b,2_b), (3_a,1).
-
C_x(N) = {my(x='x+O('x^N), h=(sum(i=1,N,(x^(2*i))/((1-x)*(1-x+x^i)*(1-sum(j=1,N, (x^j)/(1-x+x^j))))))/(1-sum(i=1,N,(x^i)/(1-x)))); concat([0,0],Vec(h))}
C_x(40)
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.
Original entry on oeis.org
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
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).
-
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)
Showing 1-2 of 2 results.