login
A391622
Numbers k such that there is a unique nonnegative sequence whose first sums are the k-th composition in standard order.
12
13, 27, 29, 41, 45, 50, 54, 55, 59, 61, 77, 83, 91, 93, 101, 105, 108, 110, 111, 114, 118, 119, 123, 125, 141, 145, 155, 157, 162, 166, 167, 169, 173, 178, 182, 183, 187, 189, 196, 202, 203, 211, 213, 216, 218, 220, 221, 222, 223, 229, 233, 236, 238, 239, 242
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 numbers k such that there is a unique integer b such that the b-based partial alternating sums of the k-th composition in standard order are all nonnegative. Here, the b-based partial alternating sums pas(q,b) of a finite sequence q are given by pas(q,b)_j = (-1)^j * b + Sum_{i=1..j} (-1)^(i+j) * q_i. This is a signed version of the partial sums transformation, inverse to the "first sums" transformation.
FORMULA
Complement of A390747 U A391623.
EXAMPLE
For n = 54, the composition (1,2,1,2) is the first sums of (0,1,1,0,2) only, so 54 is in the sequence.
The terms together with standard compositions begin:
13: (1,2,1)
27: (1,2,1,1)
29: (1,1,2,1)
41: (2,3,1)
45: (2,1,2,1)
50: (1,3,2)
54: (1,2,1,2)
55: (1,2,1,1,1)
59: (1,1,2,1,1)
61: (1,1,1,2,1)
77: (3,1,2,1)
83: (2,3,1,1)
91: (2,1,2,1,1)
93: (2,1,1,2,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], Length[Select[Table[pas[stc[#], b], {b, 0, Max[stc[#]]}], Min@@#>=0&]]==1&]
CROSSREFS
For compositions we have:
- at least one choice: A390676, count A391683
- no choices: A390677, count A391680
- unique choice: A390745, count A391644
- more than one choice: A391627, count A391628
For no choices we have A390747, counted by A391645.
For a unique positive multiset see A390448.
These are positions of 1 in A391621.
For more than one choice we have A391623, counted by A391682.
These compositions are counted by A391643.
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.
A390449 ranks first sums of prime indices, listed by A390307 or A390362.
A390673 ranks compositions with distinct first sums, counted by A390567.
A390674 ranks compositions with equal first sums, counted by A342527.
A391642 counts compositions with standard first sums.
Sequence in context: A005029 A251149 A293787 * A041330 A041765 A041328
KEYWORD
nonn
AUTHOR
Gus Wiseman, Dec 19 2025
STATUS
approved