login
A373420
Number of Carlitz compositions of n (see A003242) such that the first and last parts are equal.
0
1, 1, 1, 1, 2, 3, 2, 7, 11, 17, 26, 54, 86, 155, 272, 464, 816, 1447, 2507, 4400, 7706, 13456, 23570, 41293, 72212, 126394, 221282, 387219, 677714, 1186311, 2076170, 3633761, 6360219, 11131698, 19483066, 34100455, 59683664, 104460655, 182832044, 319999739
OFFSET
0,5
FORMULA
G.f.: 1 + Sum_{i>0} (x^i)*(C(x)*(x^i) + x^i + 1)/(1+x^i)^2 where C(x) is the g.f. for A003242.
EXAMPLE
a(7) = 7 counts: (1,2,1,2,1), (1,2,3,1), (1,3,2,1), (1,5,1), (2,3,2), (3,1,3), and (7).
PROG
(PARI)
C_x(N) = {my(g=1/(1-sum(k=1, N, x^k/(1+x^k)))); g}
A_x(i, N) = {my( x='x+O('x^N), f=(x^i)*(C_x(N)*(x^i)+x^i+1)/(1+x^i)^2); f}
D_x(N) = {my( x='x+O('x^N), f=1+sum(i=1, N, A_x(i, N))); Vec(f)}
D_x(40)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
John Tyler Rascoe, Aug 16 2024
STATUS
approved