cp's OEIS Frontend

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.

Previous Showing 11-13 of 13 results.

A054427 Permutation of natural numbers: maps the fractions A038567/A038566 to the right side (n/m > 1) of Stern-Brocot tree.

Original entry on oeis.org

1, 2, 4, 3, 8, 5, 16, 7, 6, 9, 32, 17, 64, 15, 13, 12, 10, 33, 128, 14, 11, 65, 256, 31, 25, 24, 18, 129, 512, 29, 20, 257, 1024, 63, 30, 28, 49, 48, 21, 19, 34, 513, 2048, 26, 23, 1025, 4096, 127, 61, 57, 27, 97, 96, 22, 40, 36, 66, 2049, 8192, 62, 56, 41, 35, 4097
Offset: 1

Views

Author

Keywords

Examples

			Right side of Stern-Brocot tree: 1/1 2/1 3/2 3/1 4/3 5/3 5/2 4/1 5/4 7/5 8/5 7/4 7/3 8/3 7/2 5/1
A038567/A038566: 1/1 2/1 3/1 3/2 4/1 4/3 5/1 5/2 5/3 5/4 6/1 6/5 7/1 7/2 7/3 7/4
		

Crossrefs

Inverse permutation: A054428.

Programs

  • Maple
    A038567_A038566_to_SternBrocot_permutation := proc(u) local a,n,i; a := []; for n from 1 to u do for i from 1 to n do if (1 = igcd(n,i)) then a := [op(a),cfrac2binexp(convert((n/i),confrac))+1]; fi; od; od; RETURN(a); end; # cfrac2binexp given in A054424.

A065934 Permutation of N induced by the order-preserving bijection QuQR1toQuQR2 on rationals.

Original entry on oeis.org

1, 5, 13, 2, 23, 25, 3, 9, 20, 11, 95, 49, 6, 223, 57, 4, 39, 80, 10, 45, 92, 47, 383, 97, 12, 415, 208, 55, 3583, 225, 29, 17, 36, 19, 159, 320, 40, 83, 42, 22, 183, 368, 46, 189, 380, 191, 1535, 193, 24, 799, 400, 103, 6655, 3328, 52, 220, 445, 895, 57343, 897
Offset: 1

Views

Author

Antti Karttunen, Dec 07 2001

Keywords

Comments

This permutation converts the domain between the mappings N2QuQR1 and N2QuQR2 given in A065936 and A065937, i.e. N2QuQR1(j) = N2QuQR2(a[j])

Crossrefs

Inverse permutation: A065935. For other needed Maple procedures, see A007305, A047679 and A054424. A065939[n] = a[A065938[n]].

Programs

  • Maple
    [seq(QuQR1toQuQR2(j),j=1..128)];
    QuQR1toQuQR2 := proc(n) local m; m := n + 2^floor_log_2(n); frac2position_in_whole_SB_tree(Q0_1toQ(SternBrocotTreeNum(m)/SternBrocotTreeDen(m))); end;
    Q0_1toQ := proc(rr) local r,i; r := rr; i := 0; while(r >= 1/2) do r := 2*(r-(1/2)); i := i+1; od; RETURN(i + (2*r)); end;

A338579 Triangle T(D,N) read by rows, 1 <= N < D >= 2, where T(D,N) is the position of the fraction N/D in the Farey tree (or Stern-Brocot subtree) A007305/A007306.

Original entry on oeis.org

2, 3, 4, 5, 2, 8, 9, 6, 7, 16, 17, 3, 2, 4, 32, 33, 10, 12, 13, 15, 64, 65, 5, 11, 2, 14, 8, 128, 129, 18, 3, 24, 25, 4, 31, 256, 257, 9, 20, 6, 2, 7, 29, 16, 512, 513, 34, 19, 21, 48, 49, 28, 30, 63, 1024, 1025, 17, 5, 3, 23, 2, 26, 4, 8, 32, 2048
Offset: 2

Views

Author

Hugo Pfoertner, Nov 10 2020

Keywords

Comments

Fractions are reduced to lowest terms.

Examples

			The triangle begins
     N     1   2  3  4  5  6   7   8   9   10   11   12   13    14    15
   D \------------------------------------------------------------------
   2 |     2   .  .  .  .  .   .   .   .    .    .    .    .     .     .
   3 |     3   4  .  .  .  .   .   .   .    .    .    .    .     .     .
   4 |     5   2  8  .  .  .   .   .   .    .    .    .    .     .     .
   5 |     9   6  7 16  .  .   .   .   .    .    .    .    .     .     .
   6 |    17   3  2  4 32  .   .   .   .    .    .    .    .     .     .
   7 |    33  10 12 13 15 64   .   .   .    .    .    .    .     .     .
   8 |    65   5 11  2 14  8 128   .   .    .    .    .    .     .     .
   9 |   129  18  3 24 25  4  31 256   .    .    .    .    .     .     .
  10 |   257   9 20  6  2  7  29  16 512    .    .    .    .     .     .
  11 |   513  34 19 21 48 49  28  30  63 1024    .    .    .     .     .
  12 |  1025  17  5  3 23  2  26   4   8   32 2048    .    .     .     .
  13 |  2049  66 36 40 22 96  97  27  57   61  127 4096    .     .     .
  14 |  4097  33 35 10 41 12   2  13  56   15   62   64 8192     .     .
  15 |  8193 130  9 37  3  6 192 193   7    4   60   16  255 16384     .
  16 | 16385  65 68  5 80 11  47   2  50   14  113    8  125   128 32768
.
T(7,2) = 10 because A007306(10) = 7 and A007305(10) = 2 is the required double match, i.e., the position of the fraction 2/7 in the Farey tree is 10.
T(14,4) = T(7,2) = 10, because the fraction 4/14 reduced to lowest terms is 2/7.
T(16,12) = 8, because the fraction 12/16 reduced to lowest terms is 3/4, with the double match A007306(8)=4 and A007305(8)=3.
		

Crossrefs

Programs

  • PARI
    \\ using Yosu Yurramendi's formulas
    a338579(lim)={
    my(a7305=vectorsmall(2+2^(lim+2)),a7306=vectorsmall(2+2^(lim+2)));
      a7305[1]=1;
      for(m=1,lim,
         for(k=0,2^(m-1)-1,
          a7305[2^m+k]=a7305[2^(m-1)+k];
          a7305[2^m+2^(m-1)+k]=a7305[2^(m-1)+k]+a7305[2^m-k-1]
         )
      );
      a7306[1]=1;a7306[2]=2;
      for(m=0,lim,
         for(k=1,2^m,
          a7306[2^(m+1)+k]=a7306[2^m+k] + a7306[k];
          a7306[2^(m+1)-k+1]=a7306[2^m+k]
         )
      );
       my(findinFS(x)=for(k=2,#a7306,
          if(!(a7305[k-1]/a7306[k]-x),return(k)));0);
      for(de=2,lim+2,for(nu=1,de-1,my(q=nu/de);print1(findinFS(q),", ")))
    };
    a338579(10);
    
  • PARI
    T(d,n) = my(ret=1); d-=n; while(n!=d, ret<<=1; if(n>d, n-=d;ret++, d-=n)); ret+1; \\ Kevin Ryde, Nov 11 2020
Previous Showing 11-13 of 13 results.