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 A334666 #11 May 11 2020 02:27:25 %S A334666 0,1,2,3,4,6,6,7,8,12,9,13,12,14,14,15,16,24,20,28,17,25,19,27,24,28, %T A334666 25,29,28,30,30,31,32,48,40,56,34,50,41,57,33,49,38,54,37,53,39,55,48, %U A334666 56,52,60,49,57,51,59,56,60,57,61,60,62,62,63,64,96,80 %N A334666 For any number with binary expansion (b_1, ..., b_w), replace the i-th "1" by b_i for i = 1..A000120(n) and the j-th "0" by b_{w+1-j} for j = 1..A023416(n); the resulting binary expansion is that of a(n). %C A334666 Fixed points correspond to A023758. %H A334666 Rémy Sigrist, <a href="/A334666/b334666.txt">Table of n, a(n) for n = 0..8191</a> %H A334666 <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a> %F A334666 A000120(a(n)) = A000120(n). %F A334666 A023416(a(n)) = A023416(n). %e A334666 For n = 41: %e A334666 - the binary representation of 41 is "101001", %e A334666 - the 3 1's are replaced by 1, 0, 1, respectively, %e A334666 - the 3 0's are replaced by 1, 0, 0, respectively, %e A334666 - hence we obtain "110001", %e A334666 - and a(41) = 49. %o A334666 (PARI) a(n) = { my (b=binary(n), t=vector(#b), l=0, r=#b+1); for (k=1, #b, t[k] = if (b[k], b[l++], b[r--])); fromdigits(t, 2) } %Y A334666 See A334667 for a similar sequence. %Y A334666 Cf. A000120, A023416, A023758. %K A334666 nonn,base %O A334666 0,3 %A A334666 _Rémy Sigrist_, May 07 2020