VOOZH about

URL: https://oeis.org/A392712

⇱ A392712 - OEIS


login
A392712
Numbers k such that the trimmed partial alternating sums of the k-th composition in standard order are all equal.
1
0, 1, 2, 4, 6, 8, 16, 26, 32, 40, 64, 106, 128, 256, 288, 426, 512, 648, 1024, 1706, 2048, 2176, 4096, 6826, 8192, 10376, 16384, 16896, 18464, 27306, 32768, 65536, 109226, 131072, 133120, 166024, 262144, 436906, 524288, 557184, 1048576, 1056768, 1181728
OFFSET
1,3
COMMENTS
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.
The partial alternating sums of a finite sequence q are given by pas(q)_j = Sum_{i=1..j} (-1)^(i+j) * q_i. For example, partial alternating sums of q = (a,b,c,d,e) are:
pas(q)_0 = 0
pas(q)_1 = a
pas(q)_2 = -a + b
pas(q)_3 = a - b + c
pas(q)_4 = -a + b - c + d
pas(q)_5 = a - b + c - d + e
These are trimmed by removing the zeroth line.
EXAMPLE
The 288th composition in standard order is (3,6), with partial alternating sums (0,3,3), trimmed (3,3), so 288 is in the sequence.
The terms together with their standard compositions begin:
0: ()
1: (1)
2: (2)
4: (3)
6: (1,2)
8: (4)
16: (5)
26: (1,2,2)
32: (6)
40: (2,4)
64: (7)
106: (1,2,2,2)
128: (8)
256: (9)
288: (3,6)
426: (1,2,2,2,2)
512: (10)
648: (2,4,4)
1024: (11)
1706: (1,2,2,2,2,2)
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[0, 1000], SameQ@@Rest[pas[stc[#], 0]]&]
CROSSREFS
These compositions are counted by A001227, nonprime case A069283.
For run lengths instead of partial alternating sums we have A353744, count A329738.
For run-sums instead of partial alternating sums we have A353848, count A353851.
For first differences instead of partial alternating sums we have A389731.
For first sums instead of partial alternating sums we have A390674, count A342527.
Positions of constant rows in A391983, non-singleton case A391981 or A392374.
The version for prime indices is A392700, including primes A392371, see A325230.
For distinct non-trimmed we have A392708, count A392703.
For distinct instead of equal we have A392709, count A392702.
A003242 counts anti-run compositions, ranks A333489.
A005811 counts runs in binary expansion.
A011782 counts compositions.
A066099 lists all compositions in standard order.
A097805 counts compositions by alternating sum.
A304442 counts partitions with all equal run-sums, ranks A353833.
A390432 lists first sums of standard compositions, row ranks A390568.
Sequence in context: A316225 A100685 A296993 * A068799 A317306 A317087
KEYWORD
nonn,new
AUTHOR
Gus Wiseman, Mar 08 2026
STATUS
approved