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 A139706 #20 Jun 13 2021 06:04:45 %S A139706 1,2,3,4,6,5,7,8,12,10,13,9,14,11,15,16,24,20,25,18,26,21,27,17,28,22, %T A139706 29,19,30,23,31,32,48,40,49,36,50,41,51,34,52,42,53,37,54,43,55,33,56, %U A139706 44,57,38,58,45,59,35,60,46,61,39,62,47,63,64,96,80,97,72,98,81,99,68 %N A139706 Take n in binary. Rotate the binary digits to the right until a 1 once again appears as the leftmost digit. Convert back into decimal for a(n). %C A139706 This sequence written in binary is A139707. %C A139706 This is a permutation of the positive integers. A139708 is the inverse permutation. %C A139706 Moreover, the first 2^n terms are a permutation of the first 2^n positive integers. Fixed points of the permutation are A272919. - _Ivan Neretin_, May 10 2016 %H A139706 Ivan Neretin, <a href="/A139706/b139706.txt">Table of n, a(n) for n = 1..8192</a> %H A139706 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a> %p A139706 A139706 := proc(n) local a; a := ListTools[Rotate](convert(n,base,2),1) ; while op(-1,a) = 0 do a := ListTools[Rotate](a,1) ; od: add(op(i,a)*2^(i-1),i=1..nops(a)) : end: seq(A139706(n),n=1..100) ; # _R. J. Mathar_, May 04 2008 %t A139706 Table[FromDigits[RotateRight[IntegerDigits[n, 2], IntegerExponent[n, 2] + 1], 2], {n, 72}] (* _Ivan Neretin_, May 10 2016 *) %Y A139706 Cf. A139707 (in binary), A139708 (inverse), A272919 (fixed points). %K A139706 nonn,base,easy %O A139706 1,2 %A A139706 _Leroy Quet_, Apr 30 2008 %E A139706 More terms from _R. J. Mathar_, May 04 2008