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 A273672 #11 Mar 08 2020 08:38:56 %S A273672 1,3,7,15,31,63,127,2,511,1023,2047,4095,8191,16383,32767,65535, %T A273672 131071,262143,524287,1048575,2097151,4194303,8388607,6,33554431, %U A273672 67108863,4,268435455,536870911,1073741823,2147483647,128,8589934591,17179869183,34359738367,68719476735,137438953471,274877906943,549755813887,14 %N A273672 Permutation of natural numbers induced by looking up the position of fraction A270418(n)/A270419(n) from the full Stern-Brocot tree A007305(n+1)/A047679(n-1). %H A273672 Antti Karttunen, <a href="/A273672/b273672.txt">Table of n, a(n) for n = 1..1024</a> %H A273672 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a> %o A273672 (Scheme) %o A273672 (define (A273672 n) (SBtree_index (A270418 n) (A270419 n))) %o A273672 (define (SBtree_index m n) (let loop ((m m) (n n) (z 1)) (cond ((= m n) z) ((< m n) (loop m (- n m) (+ z z))) (else (loop (- m n) n (+ z z 1)))))) %o A273672 (PARI) %o A273672 A065620(n, c=1) = sum(i=0, logint(n+!n, 2), if(bittest(n, i), (-1)^c++<<i)); \\ From A065620 %o A273672 SBtree_index(r) = { my(m=numerator(r),n=denominator(r),z=1); while(m!=n, if(m<n, n-=m; z<<=1, m-=n; z<<=1; z++)); (z); }; %o A273672 A273672(n) = { n=factor(n); n[, 2] = apply(A065620, n[, 2]); SBtree_index(factorback(n)); }; \\ _Antti Karttunen_, Mar 07 2020, based also on _M. F. Hasler_'s code in A270418 and A270419 %Y A273672 Inverse: A273671. %Y A273672 Cf. A270418, A270419. %Y A273672 Cf. also A007305, A047679. %K A273672 nonn %O A273672 1,2 %A A273672 _Antti Karttunen_, May 27 2016