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.

A357625 Numbers k such that the k-th composition in standard order has half-alternating sum 0.

This page as a plain text file.
%I A357625 #11 Jun 02 2024 14:40:27
%S A357625 0,14,15,44,45,46,52,53,54,59,61,152,153,154,156,168,169,170,172,179,
%T A357625 181,185,200,201,202,204,211,213,217,230,231,234,235,239,242,243,247,
%U A357625 254,255,560,561,562,564,568,592,593,594,596,600,611,613,617,625,656
%N A357625 Numbers k such that the k-th composition in standard order has half-alternating sum 0.
%C A357625 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 A357625 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 A357625 John Tyler Rascoe, <a href="/A357625/b357625.txt">Table of n, a(n) for n = 1..7762</a>
%H A357625 Gus Wiseman, <a href="https://docs.google.com/document/d/e/2PACX-1vTCPiJVFUXN8IqfLlCXkgP15yrGWeRhFS4ozST5oA4Bl2PYS-XTA3sGsAEXvwW-B0ealpD8qnoxFqN3/pub">Statistics, classes, and transformations of standard compositions</a>
%e A357625 The sequence together with the corresponding compositions begins:
%e A357625     0: ()
%e A357625    14: (1,1,2)
%e A357625    15: (1,1,1,1)
%e A357625    44: (2,1,3)
%e A357625    45: (2,1,2,1)
%e A357625    46: (2,1,1,2)
%e A357625    52: (1,2,3)
%e A357625    53: (1,2,2,1)
%e A357625    54: (1,2,1,2)
%e A357625    59: (1,1,2,1,1)
%e A357625    61: (1,1,1,2,1)
%t A357625 stc[n_]:=Differences[Prepend[Join @@ Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
%t A357625 halfats[f_]:=Sum[f[[i]]*(-1)^(1+Ceiling[i/2]),{i,Length[f]}];
%t A357625 Select[Range[0,100],halfats[stc[#]]==0&]
%o A357625 (Python)
%o A357625 from itertools import count, islice
%o A357625 def comp(n): #row n of A066099 after Franklin T. Adams-Watters
%o A357625     v,k = [],0
%o A357625     while n > 0:
%o A357625         k += 1
%o A357625         if n%2 == 1:
%o A357625             v.append(k)
%o A357625             k = 0
%o A357625         n = n//2
%o A357625     return(v[::-1])
%o A357625 def a_gen():
%o A357625     for n in count(0):
%o A357625         c = comp(n)
%o A357625         x = sum(c[i]*(-1)**(i//2) for i in range(len(c)))
%o A357625         if x == 0:
%o A357625             yield(n)
%o A357625 A357625_list = list(islice(a_gen(), 60)) # _John Tyler Rascoe_, Jun 01 2024
%Y A357625 See link for sequences related to standard compositions.
%Y A357625 The version for full alternating sum is A344619.
%Y A357625 Positions of zeros in A357621.
%Y A357625 The reverse version is A357626.
%Y A357625 The skew-alternating form is A357627, reverse A357628.
%Y A357625 The version for prime indices is A357631.
%Y A357625 The version for Heinz numbers of partitions is A357635.
%Y A357625 A124754 gives alternating sum of standard compositions, reverse A344618.
%Y A357625 A357637 counts partitions by half-alternating sum, skew A357638.
%Y A357625 A357641 counts comps w/ half-alt sum 0, partitions A357639, even A357642.
%Y A357625 Cf. A001511, A053251, A357136, A357182, A357183, A357184, A357185, A357622, A357623, A357629, A357633.
%K A357625 nonn
%O A357625 1,2
%A A357625 _Gus Wiseman_, Oct 08 2022