login
Number of integer compositions of n into parts that are alternately equal and unequal.
19

%I #16 Jun 01 2024 05:40:07

%S 1,1,2,1,3,3,5,5,9,7,17,14,28,25,49,42,87,75,150,132,266,226,466,399,

%T 810,704,1421,1223,2488,2143,4352,3759,7621,6564,13339,11495,23339,

%U 20135,40852,35215,71512,61639,125148,107912,219040,188839,383391,330515,670998

%N Number of integer compositions of n into parts that are alternately equal and unequal.

%H Alois P. Heinz, <a href="/A357643/b357643.txt">Table of n, a(n) for n = 0..1000</a>

%F G.f.: (1 + Sum_{k>0} (x^k)/(1 + x^(2*k)))/(1 - Sum_{k>0} (x^(2*k))/(1 + x^(2*k))). - _John Tyler Rascoe_, May 28 2024

%e The a(1) = 1 through a(8) = 9 compositions:

%e (1) (2) (3) (4) (5) (6) (7) (8)

%e (11) (22) (113) (33) (115) (44)

%e (112) (221) (114) (223) (116)

%e (1122) (331) (224)

%e (2211) (11221) (332)

%e (1133)

%e (3311)

%e (22112)

%e (112211)

%t Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],And@@Table[#[[i]]==#[[i+1]],{i,1,Length[#]-1,2}]&&And@@Table[#[[i]]!=#[[i+1]],{i,2,Length[#]-1,2}]&]],{n,0,15}]

%o (PARI)

%o C_x(N) = {my(x='x+O('x^N), h=(1+sum(k=1,N, (x^k)/(1+x^(2*k))))/(1-sum(k=1,N, (x^(2*k))/(1+x^(2*k))))); Vec(h)}

%o C_x(50) \\ _John Tyler Rascoe_, May 28 2024

%Y The even-length version is A003242, ranked by A351010, partitions A035457.

%Y Without equal relations we have A016116, equal only A001590 (apparently).

%Y The version for partitions is A351005.

%Y The opposite version is A357644, partitions A351006.

%Y A011782 counts compositions.

%Y A357621 gives half-alternating sum of standard compositions, skew A357623.

%Y A357645 counts compositions by half-alternating sum, skew A357646.

%Y Cf. A029862, A035544, A097805, A122129, A122134, A122135, A351003, A351004, A351007, A357136, A357641.

%K nonn

%O 0,3

%A _Gus Wiseman_, Oct 12 2022

%E More terms from _Alois P. Heinz_, Oct 12 2022