login
A357706
Numbers k such that the k-th composition in standard order has half-alternating sum and skew-alternating sum both 0.
2
0, 15, 45, 54, 59, 153, 170, 179, 204, 213, 230, 235, 247, 255, 561, 594, 611, 660, 677, 710, 715, 727, 735, 750, 765, 792, 809, 842, 851, 871, 879, 894, 908, 917, 934, 939, 951, 959, 973, 982, 987, 1005, 1014, 1019
OFFSET
1,2
COMMENTS
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 - ..., and the skew-alternating sum to be A - B - C + D + E - F - G + ...
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.
FORMULA
Intersection of A357625 and A357627.
MATHEMATICA
stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n, 2]], 1], 0]]//Reverse;
halfats[f_]:=Sum[f[[i]]*(-1)^(1+Ceiling[i/2]), {i, Length[f]}];
skats[f_]:=Sum[f[[i]]*(-1)^(1+Ceiling[(i+1)/2]), {i, Length[f]}];
Select[Range[0, 1000], halfats[stc[#]]==0&&skats[stc[#]]==0&]
CROSSREFS
For partitions and half only (or both): A000583, counted by A035363.
These compositions are counted by A228248.
For half-alternating only: A357625, reverse A357626, counted by A357641.
For skew-alternating only: A357627, reverse A357628, counted by A001700.
For reversed partitions and half only: A357631, counted by A357639.
For reversed partitions and skew only A357632, counted by A357640.
For partitions and skew only: A357636, counted by A035594.
Sequence in context: A289669 A295980 A029827 * A119123 A293625 A084821
KEYWORD
nonn
AUTHOR
Gus Wiseman, Oct 13 2022
STATUS
approved