cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Oct 12 2022

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)
		

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.

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