editing
approved
editing
approved
Number of Carlitz compositions of n (see A003242) such that the first and last parts are equal.
proposed
editing
editing
proposed
C_x(N) = { my(g =1/(1-sum(k=1, N, x^k/(1+x^k)))); g}
allocated for John Tyler RascoeNumber of Carlitz compositions of n such that the first part and last part are equal.
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
0,5
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.
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).
(PARI)
C_x(N) = { my(g =1/(1-sum(k=1, N, x^k/(1+x^k)))); g}
A_x(i, N) = {my( 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(20)
allocated
nonn,easy
John Tyler Rascoe, Aug 16 2024
approved
editing
allocated for John Tyler Rascoe
recycled
allocated
editing
approved
1, 1, 1, 1, 1, 2, 2, 1, 3, 4, 4, 3, 5, 8, 8, 5, 11, 16, 16, 11, 21, 32, 32, 21, 43, 64, 64, 43, 85, 128, 128, 85, 171, 256, 256, 171, 341, 512, 512, 341, 683, 1024, 1024, 683, 1365, 2048, 2048, 1365, 2731, 4096, 4096, 2731, 5461, 8192, 8192, 5461, 10923, 16384
0,6
<a href="/index/Rec#order_08">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,0,1,0,0,0,2).
a(4*n+1) + a(4*n+1) + a(4*n+2) + a(4*n+3) = 4, 6, 14, 26, ... = A084214(n+2) = 2*A048573(n).
a(2*n) + a(2*n+1) = 2, 2, 3, 3, 7, 7, ... = repeat A048573(n).
a(3*n) + a(3*n+1) + a(3*n+2) = 3, 4, 6, 11, 21, 32, 48, 85, 171, 256, 384 ... = b(n). 3, 11, 21, 85, 171, ... are from A001045. b(2*n) is divisible by 3.
nonn,easy,changed
recycled
Paul Curtz, Aug 03 2024
proposed
editing