A357643 Number of integer compositions of n into parts that are alternately equal and unequal.
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
Keywords
Examples
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)
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..1000
Programs
-
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}]
-
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
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
Extensions
More terms from Alois P. Heinz, Oct 12 2022