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 A283997 #30 May 06 2021 11:04:24 %S A283997 0,1,3,2,7,6,2,3,15,14,2,3,6,7,5,4,31,30,2,3,6,7,5,4,14,15,13,12,5,4, %T A283997 4,5,63,62,2,3,6,7,5,4,14,15,13,12,5,4,4,5,30,31,29,28,5,4,4,5,13,12, %U A283997 12,13,4,5,7,6,127,126,2,3,6,7,5,4,14,15,13,12,5,4,4,5,30,31,29,28,5,4,4,5,13,12,12,13,4,5,7,6,62,63,61,60,5,4,4,5,13,12,12 %N A283997 a(n) = n XOR A005187(floor(n/2)), where XOR is bitwise-xor (A003987). %H A283997 Antti Karttunen, <a href="/A283997/b283997.txt">Table of n, a(n) for n = 0..8191</a> %H A283997 <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a> %F A283997 a(n) = n XOR A005187(floor(n/2)), where XOR is bitwise-xor (A003987). %F A283997 a(n) = A283996(n) - A283998(n). %F A283997 a(n) = A005187(n) - 2*A283998(n). %F A283997 a(n) = A006068(n) XOR A283999(floor(n/2)). %t A283997 Table[BitXor[n, 2 # - DigitCount[2 #, 2, 1] &@ Floor[n/2]], {n, 0, 106}] (* _Michael De Vlieger_, Mar 20 2017 *) %o A283997 (Scheme) (define (A283997 n) (A003987bi n (A005187 (floor->exact (/ n 2))))) ;; Where A003987bi implements bitwise-XOR (A003987). %o A283997 (PARI) b(n) = if(n<1, 0, b(n\2) + n%2); %o A283997 A(n) = 2*n - b(2*n); %o A283997 for(n=0, 110, print1(bitxor(n, A(floor(n/2))),", ")) \\ _Indranil Ghosh_, Mar 25 2017 %o A283997 (Python) %o A283997 def A(n): return 2*n - bin(2*n)[2:].count("1") %o A283997 print([n^A(n//2) for n in range(111)]) # _Indranil Ghosh_, Mar 25 2017 %Y A283997 Cf. A003986, A005187, A006068, A283996, A283998, A283999. %Y A283997 Cf. also A279357, A283477. %K A283997 nonn,base,hear %O A283997 0,3 %A A283997 _Antti Karttunen_, Mar 19 2017