A025049 Number of down/up (initially descending) compositions of n.
1, 1, 1, 2, 2, 4, 6, 9, 14, 23, 35, 55, 87, 136, 214, 337, 528, 830, 1306, 2051, 3223, 5067, 7962, 12512, 19667, 30908, 48574, 76343, 119982, 188565, 296358, 465764, 732006, 1150447, 1808078, 2841627, 4465992, 7018891, 11031101, 17336823, 27247087, 42822355
Offset: 0
Keywords
Examples
From _Gus Wiseman_, Jan 28 2022: (Start) The a(1) = 1 through a(8) = 14 down/up compositions: (1) (2) (3) (4) (5) (6) (7) (8) (2,1) (3,1) (3,2) (4,2) (4,3) (5,3) (4,1) (5,1) (5,2) (6,2) (2,1,2) (2,1,3) (6,1) (7,1) (3,1,2) (2,1,4) (2,1,5) (2,1,2,1) (3,1,3) (3,1,4) (4,1,2) (3,2,3) (2,1,3,1) (4,1,3) (3,1,2,1) (5,1,2) (2,1,3,2) (2,1,4,1) (3,1,3,1) (4,1,2,1) (2,1,2,1,2) (End)
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..1000
- Mohammed L. Nadji, Moussa Ahmia, Daniel F. Checa, and José L. Ramírez, Arndt Compositions with Restricted Parts, Palindromes, and Colored Variants, J. Int. Seq. (2025) Vol. 28, Issue 3, Article 25.3.6. See p. 12.
- Wikipedia, Alternating permutation
Crossrefs
Programs
-
Mathematica
doupQ[y_]:=And@@Table[If[EvenQ[m],y[[m]]
y[[m+1]]],{m,1,Length[y]-1}]; Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],doupQ]],{n,0,15}] (* Gus Wiseman, Jan 28 2022 *)
Formula
Extensions
a(0)=1 prepended by Alois P. Heinz, Jan 20 2022
Name changed by Gus Wiseman, Jan 28 2022
Comments