This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A322017 #10 Dec 20 2018 23:18:20 %S A322017 0,0,1,0,3,4,7,0,7,8,9,12,0,12,15,0,15,16,17,0,19,20,23,24,0,24,25,28, %T A322017 0,28,31,0,31,32,33,0,35,36,39,0,39,40,41,44,0,44,47,48,0,48,49,0,51, %U A322017 52,55,56,0,56,57,60,0,60,63,0,63,64,65,0,67,68,71,0,71,72,73,76,0,76,79,0,79,80,81,0,83,84,87,88,0,88,89 %N A322017 a(0) = 0; for n > 0, if A003188(n) > A003188(n-1) then a(n) = n-1, else if A003188(n+1) < A003188(n) then a(n) = n+1, otherwise a(n) = 0. %C A322017 For all n, A207901(a(n)) divides A207901(n), and similarly for A302033. %H A322017 Antti Karttunen, <a href="/A322017/b322017.txt">Table of n, a(n) for n = 0..16383</a> %H A322017 <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a> %t A322017 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 *) %o A322017 (PARI) %o A322017 A003188(n) = bitxor(n, n>>1); %o A322017 A322017(n) = if(0==n, 0, if(A003188(n)>A003188(n-1), n-1, if(A003188(1+n) < A003188(n), n+1, 0))); %Y A322017 Cf. A003188, A322015, A322016, A322018. %Y A322017 Cf. also A207901, A302033. %K A322017 nonn %O A322017 0,5 %A A322017 _Antti Karttunen_, Nov 24 2018