OFFSET
1,1
COMMENTS
The first sums of a nonempty sequence (a, b, c, d, ...) are (a+b, b+c, c+d, ...).
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.
Also integers k such that for no b are the b-based partial alternating sums of the k-th composition in standard order all nonnegative.
LINKS
EXAMPLE
For n = 24 there are two nonnegative sequences whose first sums are (1,4), namely (0,1,3) and (1,0,4), so 24 is not in the sequence.
For n = 25 there are no nonnegative sequences whose first sums are (1,3,1), so 25 is in the sequence.
For n = 52 there are two nonnegative sequences whose first sums are (1,2,3), namely (0,1,1,2) and (1,0,2,1), so 52 is not in the sequence.
For n = 150, all sequences with first sums (3,2,1,2) are of the form (b,3-b,-1+b,2-b,b) for some b. This is nonnegative for b = 1 or b = 2, so 150 is not in the sequence.
The terms together with the corresponding standard compositions begin:
25: (1,3,1)
49: (1,4,1)
51: (1,3,1,1)
57: (1,1,3,1)
81: (2,4,1)
89: (2,1,3,1)
97: (1,5,1)
98: (1,4,2)
99: (1,4,1,1)
102: (1,3,1,2)
103: (1,3,1,1,1)
109: (1,2,1,2,1)
113: (1,1,4,1)
115: (1,1,3,1,1)
121: (1,1,1,3,1)
153: (3,1,3,1)
161: (2,5,1)
163: (2,4,1,1)
177: (2,1,4,1)
179: (2,1,3,1,1)
185: (2,1,1,3,1)
MATHEMATICA
stc[n_]:=Differences[Prepend[Join @@ Position[Reverse[IntegerDigits[n, 2]], 1], 0]]//Reverse;
pas[y_, k_]:=Table[(-1)^j*k+Sum[(-1)^(i-j)*y[[i]], {i, j}], {j, 0, Length[y]}];
Select[Range[100], Select[Table[pas[stc[#], b], {b, 0, Max[stc[#]]}], Min@@#>=0&]=={}&]
CROSSREFS
For positive instead of nonnegative sequences we have A390677.
These are positions of 0 in A391621.
For more than one choice we have A391623.
These compositions are counted by A391645.
A011782 counts compositions.
A066099 lists all compositions in standard order.
A357213 counts compositions by sum of first sums.
A390432 lists first sums of standard compositions.
KEYWORD
nonn
AUTHOR
Gus Wiseman, Dec 19 2025
STATUS
approved
