login
A357643
Number of integer compositions of n into parts that are alternately equal and unequal.
19
1, 1, 2, 1, 3, 3, 5, 5, 9, 7, 17, 14, 28, 25, 49, 42, 87, 75, 150, 132, 266, 226, 466, 399, 810, 704, 1421, 1223, 2488, 2143, 4352, 3759, 7621, 6564, 13339, 11495, 23339, 20135, 40852, 35215, 71512, 61639, 125148, 107912, 219040, 188839, 383391, 330515, 670998
OFFSET
0,3
LINKS
FORMULA
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
EXAMPLE
The a(1) = 1 through a(8) = 9 compositions:
(1) (2) (3) (4) (5) (6) (7) (8)
(11) (22) (113) (33) (115) (44)
(112) (221) (114) (223) (116)
(1122) (331) (224)
(2211) (11221) (332)
(1133)
(3311)
(22112)
(112211)
MATHEMATICA
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}]
PROG
(PARI)
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)}
C_x(50) \\ John Tyler Rascoe, May 28 2024
CROSSREFS
The even-length version is A003242, ranked by A351010, partitions A035457.
Without equal relations we have A016116, equal only A001590 (apparently).
The version for partitions is A351005.
The opposite version is A357644, partitions A351006.
A011782 counts compositions.
A357621 gives half-alternating sum of standard compositions, skew A357623.
A357645 counts compositions by half-alternating sum, skew A357646.
Sequence in context: A107237 A070047 A101198 * A034394 A058689 A173510
KEYWORD
nonn
AUTHOR
Gus Wiseman, Oct 12 2022
EXTENSIONS
More terms from Alois P. Heinz, Oct 12 2022
STATUS
approved