OFFSET
0,5
LINKS
MATHEMATICA
g[n_] := BitXor[n, Floor[n/2]]; a[n_] := If[n == 0, 0, If[g[n] > g[n-1], n-1, If[g[n+1] < g[n], n+1, 0]]]; Array[a, 100, 0] (* Amiram Eldar, Dec 05 2018 *)
PROG
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Nov 24 2018
STATUS
approved