OFFSET
0,5
LINKS
FORMULA
a(0) = 0; for n > 0, a(n) = (1/2)*(A034947(n)+1)*(n-1).
MATHEMATICA
With[{nn = 98}, {0, 0}~Join~Most@ ReplacePart[ConstantArray[0, nn], Map[# -> # &, Position[Partition[Array[BitXor[#, Floor[#/2]] &, nn], 2, 1], _?(First@ # < Last@ # &), {1}, Heads -> False][[All, 1]] ]]] (* Michael De Vlieger, Nov 25 2018 *)
Join[{0, 0}, With[{t=Partition[Table[BitXor[n, Floor[n/2]], {n, 100}], 2, 1]}, Flatten[ If[#[[1]]<#[[2]], Position[t, #], 0]&/@t]]] (* Harvey P. Dale, Jan 28 2021 *)
PROG
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Nov 24 2018
STATUS
approved