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 A283996 #19 May 08 2021 23:05:52 %S A283996 0,1,3,3,7,7,6,7,15,15,10,11,14,15,15,15,31,31,18,19,22,23,23,23,30, %T A283996 31,31,31,29,29,30,31,63,63,34,35,38,39,39,39,46,47,47,47,45,45,46,47, %U A283996 62,63,63,63,53,53,54,55,61,61,62,63,60,61,63,63,127,127,66,67,70,71,71,71,78,79,79,79,77,77,78,79,94,95,95,95,85,85,86,87,93,93,94,95 %N A283996 a(n) = n OR A005187(floor(n/2)), where OR is bitwise-or (A003986). %H A283996 Antti Karttunen, <a href="/A283996/b283996.txt">Table of n, a(n) for n = 0..8191</a> %H A283996 <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a> %F A283996 a(n) = n OR A005187(floor(n/2)), where OR is bitwise-or (A003986). %F A283996 a(n) = A283997(n) + A283998(n). %F A283996 a(n) = A005187(n) - A283998(n). %t A283996 A[n_]:=2*n - DigitCount[2*n, 2, 1]; Table[BitOr[n, A[Floor[n/2]]], {n,0,100}] (* _Indranil Ghosh_, Mar 25 2017 *) %o A283996 (Scheme) (define (A283996 n) (A003986bi n (A005187 (floor->exact (/ n 2))))) ;; Where A003986bi implements bitwise-OR (A003986). %o A283996 (PARI) b(n) = if(n<1, 0, b(n\2) + n%2); %o A283996 A(n) = 2*n - b(2*n); %o A283996 for(n=0, 100, print1(bitor(n, A(floor(n/2))),", ")) \\ _Indranil Ghosh_, Mar 25 2017 %o A283996 (Python) %o A283996 def A(n): return 2*n - bin(2*n)[2:].count("1") %o A283996 print([n|A(n//2) for n in range(101)]) # _Indranil Ghosh_, Mar 25 2017 %Y A283996 Cf. A003986, A005187, A283997, A283998. %K A283996 nonn,base %O A283996 0,3 %A A283996 _Antti Karttunen_, Mar 19 2017