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 A367307 #43 Apr 27 2024 03:34:56 %S A367307 0,1,2,3,4,6,5,7,8,12,10,13,9,11,14,15,16,24,20,25,18,21,26,27,17,19, %T A367307 22,23,28,30,29,31,32,48,40,49,36,41,50,51,34,37,42,43,52,54,53,55,33, %U A367307 35,38,39,44,46,45,47,56,60,58,61,57,59,62,63,64,96,80,97 %N A367307 Reverse bits in blocks in binary expansion of n where blocks are separated by every second 1 bit starting from the most significant 1 bit as the first separator. %C A367307 Self-inverse permutation of nonnegative integers. %H A367307 Rémy Sigrist, <a href="/A367307/b367307.txt">Table of n, a(n) for n = 0..8192</a> %H A367307 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the nonnegative integers</a> %F A367307 a(n) = b(c(f(n)) + g(n)) = b(h(c(n))) for n > 0 with a(0) = 0 where %F A367307 b(n) = b(f(h(n))) + g(n) for n > 0 with b(0) = 0, %F A367307 c(n) = h(c(f(n)) + g(n)) for n > 0 with c(0) = 0, %F A367307 f(n) = A053645(n), g(n) = A053644(n) and where h(n) = A059893(n). %F A367307 Note that c (A333776) is the inverse permutation to b (A333777). %F A367307 a(n) < 2^k iff n < 2^k for k >= 0. %e A367307 For n = 100930, reversals are each (...) block %e A367307 n = 100930 = binary 1(1000)1(0100)1(000010) %e A367307 a(n) = 72016 = binary 1(0001)1(0010)1(010000) %o A367307 (PARI) a(n) = my(v1); v1 = binary(n); my(A = 1); while(A <= #v1, my(B = A, C = 0, D); A++; while(A <= #v1, C += v1[A]; if(v1[A] && (C == 1), D = A); if(C < 2, A++, break)); if(C > 0, v1[D] = 0; v1[A + B - D] = 1)); fromdigits(v1, 2) %Y A367307 Cf. A053644, A053645, A059893, A333776, A333777. %K A367307 nonn,base,easy %O A367307 0,3 %A A367307 _Mikhail Kurkov_, Nov 13 2023