OFFSET
1,2
COMMENTS
EXAMPLE
A010060 = (0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,,...) = (s(1), s(2), ... ).
(init. bl. #1) = (0); reversal = (0), first occurs s(1), so that a(1) = 1;
(init. bl. #2) = (0,1); reversal = (1,0) first occurs at s(3), so that a(2) = 3;
(init. bl. #3) = (0,1,1); reversal = (1,1,0) first occurs s(2), so that a(3) = 2.
MATHEMATICA
seq = Table[Mod[Length[FixedPointList[BitAnd[#, # - 1] &, n]], 2], {n, 0, 400}] (* A010060 *)
seq = StringJoin[Map[ToString, seq]]
breverse[seq_] := Flatten[Last[Reap[NestWhile[# + 1 &, 1, (StringLength[
str = StringTake[seq, Min[StringLength[seq], #]]] == # && ! (Sow[
StringPosition[seq, StringReverse[str], 1][[1]][[1]]]) === {}) &]]]];
breverse[seq] (* A280512 *) (* Peter J. C. Moses, Jan 01 2017 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, Feb 10 2017
STATUS
approved