The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A357622 Half-alternating sum of the reversed n-th composition in standard order. 13
0, 1, 2, 2, 3, 3, 3, 1, 4, 4, 4, 0, 4, 2, 2, 0, 5, 5, 5, -1, 5, 1, 1, -1, 5, 3, 3, -1, 3, 1, 1, 1, 6, 6, 6, -2, 6, 0, 0, -2, 6, 2, 2, -2, 2, 0, 0, 2, 6, 4, 4, -2, 4, 0, 0, 0, 4, 2, 2, 0, 2, 2, 2, 2, 7, 7, 7, -3, 7, -1, -1, -3, 7, 1, 1, -3, 1, -1, -1, 3, 7, 3 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
COMMENTS
We define the half-alternating sum of a sequence (A, B, C, D, E, F, G, ...) to be A + B - C - D + E + F - G - ...
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.
LINKS
EXAMPLE
The 357-th composition is (2,1,3,2,1) so a(357) = 1 + 2 - 3 - 1 + 2 = 1.
MATHEMATICA
stc[n_]:=Differences[Prepend[Join @@ Position[Reverse[IntegerDigits[n, 2]], 1], 0]]//Reverse;
halfats[f_]:=Sum[f[[i]]*(-1)^(1+Ceiling[i/2]), {i, Length[f]}];
Table[halfats[Reverse[stc[n]]], {n, 0, 100}]
CROSSREFS
See link for sequences related to standard compositions.
This is the reverse version of A357621.
The skew-alternating form is A357624, non-reverse A357623.
Positions of zeros are A357626, reverse A357625.
The version for prime indices is A357629.
The version for Heinz numbers of partitions is A357633.
A124754 gives alternating sum of standard compositions, reverse A344618.
A357637 counts partitions by half-alternating sum, skew A357638.
A357641 counts comps w/ half-alt sum 0, partitions A357639, even A357642.
Sequence in context: A048485 A127714 A283763 * A357621 A220604 A331484
KEYWORD
sign
AUTHOR
Gus Wiseman, Oct 08 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.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 14 07:57 EDT 2024. Contains 372530 sequences. (Running on oeis4.)