login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Numbers k such that the k-th composition in standard order has half-alternating sum and skew-alternating sum both 0.
2

%I #6 Oct 13 2022 12:28:23

%S 0,15,45,54,59,153,170,179,204,213,230,235,247,255,561,594,611,660,

%T 677,710,715,727,735,750,765,792,809,842,851,871,879,894,908,917,934,

%U 939,951,959,973,982,987,1005,1014,1019

%N Numbers k such that the k-th composition in standard order has half-alternating sum and skew-alternating sum both 0.

%C 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 + ...

%C 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.

%F Intersection of A357625 and A357627.

%t stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;

%t halfats[f_]:=Sum[f[[i]]*(-1)^(1+Ceiling[i/2]),{i,Length[f]}];

%t skats[f_]:=Sum[f[[i]]*(-1)^(1+Ceiling[(i+1)/2]),{i,Length[f]}];

%t Select[Range[0,1000],halfats[stc[#]]==0&&skats[stc[#]]==0&]

%Y For partitions and half only (or both): A000583, counted by A035363.

%Y These compositions are counted by A228248.

%Y For half-alternating only: A357625, reverse A357626, counted by A357641.

%Y For skew-alternating only: A357627, reverse A357628, counted by A001700.

%Y For reversed partitions and half only: A357631, counted by A357639.

%Y For reversed partitions and skew only A357632, counted by A357640.

%Y For partitions and skew only: A357636, counted by A035594.

%Y Cf. A001511, A004006, A088218, A357136, A357182, A357642.

%K nonn

%O 1,2

%A _Gus Wiseman_, Oct 13 2022