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 A053642 #31 Jan 16 2024 08:31:24 %S A053642 1,1,3,1,3,6,7,1,3,6,7,12,13,14,15,1,3,6,7,12,13,14,15,24,25,26,27,28, %T A053642 29,30,31,1,3,6,7,12,13,14,15,24,25,26,27,28,29,30,31,48,49,50,51,52, %U A053642 53,54,55,56,57,58,59,60,61,62,63,1 %N A053642 Rotate n one binary digit to the left, drop leading zeros, then rotate one binary digit to the right. %C A053642 Sequence contains ever-longer copies of A004760. - _Ralf Stephan_, Sep 16 2003 %H A053642 Paolo Xausa, <a href="/A053642/b053642.txt">Table of n, a(n) for n = 1..10000</a> %F A053642 a(n) = A038572(A006257(n)). %F A053642 a(n) = n if 3*2^(k-1) <= n < 2^(k+1); %F A053642 a(n) = a(n - 2^(k-1)) if 2^k <= n < 3*2^(k-1). %F A053642 a(2n) = 2a(n) - [a(n)==1], a(2n+1) = 2a(n) + 1. - _Ralf Stephan_, Sep 16 2003 %e A053642 a(22)=14 because starting with 10110 the left rotation produces 01101 written as 1101 (i.e., 13) and the right rotation produces 1110 (i.e., 14). %t A053642 rtt[f_, n_] := FromDigits[f[IntegerDigits[n, 2]], 2]; %t A053642 Array[rtt[RotateRight, rtt[RotateLeft, #]]&, 100] (* _Paolo Xausa_, Jan 16 2024 *) %o A053642 (PARI) a(n) = n-=1<<logint(n,2); n + 1<<if(n,logint(n,2)+1); \\ _Kevin Ryde_, Jan 13 2024 %Y A053642 Cf. A004760, A006257, A038572. %Y A053642 Cf. A053641 (right then left). %K A053642 nonn,base,easy %O A053642 1,3 %A A053642 _Henry Bottomley_, Mar 22 2000