The OEIS is supported by the many generous donors to the OEIS Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A357184 Numbers k such that the k-th composition in standard order has the same length as its alternating sum. 20
 0, 1, 9, 19, 22, 28, 34, 69, 74, 84, 104, 132, 135, 141, 153, 177, 225, 265, 271, 274, 283, 286, 292, 307, 310, 316, 328, 355, 358, 364, 376, 400, 451, 454, 460, 472, 496, 520, 523, 526, 533, 538, 553, 562, 593, 610, 673, 706, 833, 898, 1041, 1047, 1053, 1058 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,3 COMMENTS A composition of n is a finite sequence of positive integers summing to n. The k-th composition in standard order (graded reverse-lexicographic, A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, taking first differences, and reversing again. This gives a bijective correspondence between nonnegative integers and integer compositions. The alternating sum of a sequence (y_1,...,y_k) is Sum_i (-1)^(i-1) y_i. LINKS Table of n, a(n) for n=1..54. Gus Wiseman, Statistics, classes, and transformations of standard compositions EXAMPLE The sequence together with the corresponding compositions begins: 0: () 1: (1) 9: (3,1) 19: (3,1,1) 22: (2,1,2) 28: (1,1,3) 34: (4,2) 69: (4,2,1) 74: (3,2,2) 84: (2,2,3) 104: (1,2,4) 132: (5,3) 135: (5,1,1,1) 141: (4,1,2,1) 153: (3,1,3,1) 177: (2,1,4,1) 225: (1,1,5,1) MATHEMATICA stc[n_]:=Differences[Prepend[Join @@ Position[Reverse[IntegerDigits[n, 2]], 1], 0]]//Reverse; ats[y_]:=Sum[(-1)^(i-1)*y[[i]], {i, Length[y]}]; Select[Range[0, 100], Length[stc[#]]==ats[stc[#]]&] CROSSREFS See link for sequences related to standard compositions. For product equal to sum we have A335404, counted by A335405. For sum equal to twice alternating sum we have A348614, counted by A262977. These compositions are counted by A357182. For absolute value we have A357184, counted by A357183. The case of partitions is counted by A357189. A003242 counts anti-run compositions, ranked by A333489. A011782 counts compositions. A025047 counts alternating compositions, ranked by A345167. A032020 counts strict compositions, ranked by A233564. A124754 gives alternating sums of standard compositions. A238279 counts compositions by sum and number of maximal runs. A357136 counts compositions by alternating sum. Cf. A000120, A070939, A114220, A114901, A178470, A242882, A262046, A301987. Sequence in context: A075981 A079368 A167529 * A228610 A106677 A350261 Adjacent sequences: A357181 A357182 A357183 * A357185 A357186 A357187 KEYWORD nonn AUTHOR Gus Wiseman, Sep 28 2022 STATUS approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified September 21 18:26 EDT 2023. Contains 365503 sequences. (Running on oeis4.)