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.

A357621 Half-alternating sum of the n-th composition in standard order.

This page as a plain text file.
%I A357621 #11 Oct 08 2022 08:34:20
%S A357621 0,1,2,2,3,3,3,1,4,4,4,2,4,2,0,0,5,5,5,3,5,3,1,1,5,3,1,1,-1,-1,-1,1,6,
%T A357621 6,6,4,6,4,2,2,6,4,2,2,0,0,0,2,6,4,2,2,0,0,0,2,-2,-2,-2,0,-2,0,2,2,7,
%U A357621 7,7,5,7,5,3,3,7,5,3,3,1,1,1,3,7,5,3,3,1
%N A357621 Half-alternating sum of the n-th composition in standard order.
%C A357621 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 - ...
%C A357621 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.
%H A357621 Gus Wiseman, <a href="https://docs.google.com/document/d/e/2PACX-1vTCPiJVFUXN8IqfLlCXkgP15yrGWeRhFS4ozST5oA4Bl2PYS-XTA3sGsAEXvwW-B0ealpD8qnoxFqN3/pub">Statistics, classes, and transformations of standard compositions</a>
%F A357621 Positions of first appearances are powers of 2 and even powers of 2 times 7, or A029746 without 7.
%e A357621 The 358-th composition is (2,1,3,1,2) so a(358) = 2 + 1 - 3 - 1 + 2 = 1.
%t A357621 stc[n_]:=Differences[Prepend[Join @@ Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
%t A357621 halfats[f_]:=Sum[f[[i]]*(-1)^(1+Ceiling[i/2]),{i,Length[f]}];
%t A357621 Table[halfats[stc[n]],{n,0,100}]
%Y A357621 See link for sequences related to standard compositions.
%Y A357621 The reverse version is A357622.
%Y A357621 The skew-alternating form is A357623, reverse A357624.
%Y A357621 Positions of zeros are A357625, reverse A357626.
%Y A357621 The version for prime indices is A357629.
%Y A357621 The version for Heinz numbers of partitions is A357633.
%Y A357621 A357637 counts partitions by half-alternating sum, skew A357638.
%Y A357621 A357641 counts comps w/ half-alt sum 0, partitions A357639, even A357642.
%Y A357621 Cf. A001511, A053251, A357136, A357182, A357183, A357184, A357185.
%Y A357621 Cf. A357627, A357628, A357630, A357631, A357634, A357635, A357640.
%K A357621 sign
%O A357621 0,3
%A A357621 _Gus Wiseman_, Oct 07 2022