

A357706


Numbers k such that the kth composition in standard order has halfalternating sum and skewalternating 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
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,2


COMMENTS

We define the halfalternating sum of a sequence (A, B, C, D, E, F, G, ...) to be A + B  C  D + E + F  G  ..., and the skewalternating sum to be A  B  C + D + E  F  G + ...
The kth composition in standard order (graded reverselexicographic, 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.


LINKS



FORMULA



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

These compositions are counted by A228248.


KEYWORD

nonn


AUTHOR



STATUS

approved



