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 A367306 #21 May 26 2024 00:39:48 %S A367306 0,1,2,3,4,5,6,7,8,10,9,11,12,13,14,15,16,20,17,21,18,19,22,23,24,26, %T A367306 25,27,28,29,30,31,32,40,33,41,34,35,42,43,36,37,38,39,44,45,46,47,48, %U A367306 52,49,53,50,51,54,55,56,58,57,59,60,61,62,63,64,80,65,81 %N A367306 Move bits in blocks in binary expansion of n where blocks are defined in Comments. %C A367306 Define the "blocks" of the binary expansion of n as runs of 0's followed by a 1 bit and additionally followed with a 0 bit if it lies immediately after the 1 bit. For example, the blocks in 45986 (shown in parentheses) are 1(01)1(001)11(010)(0010). To obtain binary expansion of a(n) from binary expansion of n, move the rightmost bit in each block to the position after leftmost bit in the same block and leave all other 1 bits unchanged (see the Example). %H A367306 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the nonnegative integers</a> %F A367306 a(n) < 2^k iff n < 2^k for k >= 0. %F A367306 Conjecture: a(n) = A200714(p(n) + 1) where p(n) is an inverse permutation to A358654. %e A367306 For n = 45986, moves are in each (...) block %e A367306 n = 45986 = binary 1(01)1(001)11(010)(0010) %e A367306 a(n) = 46481 = binary 1(01)1(010)11(001)(0001) %e A367306 We have moves in last 3 blocks, while in the first block the rightmost 1 bit is already lies on the position after leftmost bit in block, so we have no change in this case. %o A367306 (PARI) a(n) = my(v1); v1 = binary(n); my(A = 1); while(A <= #v1, while(A <= #v1 && v1[A], A++); my(B = A); while((A + 1) <= #v1 && !v1[A + 1], A++); if(A < #v1, if((A + 2) <= #v1 && !v1[A + 2], B = A; A++); v1[A + 1] = !v1[A + 1]; v1[B + 1] = !v1[B + 1]); A += 2); fromdigits(v1, 2) %Y A367306 Cf. A200714, A358654. %K A367306 nonn,base %O A367306 0,3 %A A367306 _Mikhail Kurkov_, Nov 13 2023