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.

Showing 1-5 of 5 results.

A065938 Position of sqrt(n) in the mapping N2QuQR1 given in A065936.

Original entry on oeis.org

1, 6, 14, 7, 120, 248, 16160, 1019, 127, 32640, 65408, 16373, 8386032, 4194056, 4194239, 32767, 2147450880, 4294934528, 4611672824287851743, 268435343, 8796091842564, 1125899889968159, 70368744112268, 70368744161279
Offset: 1

Views

Author

Antti Karttunen, Dec 07 2001

Keywords

Crossrefs

Cf. A003285. N2QuQR1(a[n])^2 = n, see A065936. For frac2position_in_0_1_SB_tree see A065658. Cf. also A065939.

Programs

  • Maple
    [seq(frac2position_in_0_1_SB_tree(sqrt_n_confrac2binfrac(j)),j=1..40)];
    sqrt_n_confrac2binfrac := proc(n) local c,t; c := CONFRACS_FOR_sqrt_N[n]; t := `if`((1 = nops(c)),[],`if`((0 = (nops(c) mod 2)),[op(c[2..nops(c)]),op(c[2..nops(c)])],c[2..nops(c)])); RETURN( (((2^c[1])-1) + `if`(1 = nops(c),0,(runcounts2binexp0(t) / ((2^(convert(t,`+`)))-1)))) / (2^c[1])); end;
    runcounts2binexp0 := proc(c) local i,e,n; n := 0; for i from 0 to nops(c)-1 do e := c[i+1]; n := ((2^e)*n) + ((i mod 2)*((2^e)-1)); od; RETURN(n); end;
    CONFRACS_FOR_sqrt_N := [[1], [1, 2], [1, 1, 2], [2], [2, 4], [2, 2, 4], [2, 1, 1, 1, 4], [2, 1, 4], [3], [3, 6], etc., adapted from Weisstein's encyclopedia entry for Continued Fractions]

A065810 Sorted positions of the elements of the quasicyclic group Z+(2a+1)/(2^b) [a > 0 and a < 2^(b-1), b > 0] at the ]0,1[ side of the Stern-Brocot Tree (A007305/A007306).

Original entry on oeis.org

1, 4, 7, 10, 13, 46, 49, 64, 67, 79, 112, 124, 127, 139, 151, 232, 244, 262, 310, 325, 349, 352, 364, 403, 415, 418, 442, 457, 505, 571, 583, 661, 685, 766, 769, 850, 874, 952, 964, 1057, 1126, 1432, 1519, 1552, 1639, 1945, 2014, 2050, 2140, 2434, 2458
Offset: 1

Views

Author

Antti Karttunen, Nov 22 2001

Keywords

Comments

It is easily proved that in the denominators given by A007306, the even values occur only at every third position, but can one find a simple rule for these positions of the denominators which are the powers of 2 only?

Crossrefs

Permutation of A065674. Cf. A065811, A065812. Gives the positions of zeros in A065936.

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;

A065937 a(n) is the integer (reduced squarefree) under the square root obtained when the inverse of Minkowski's question mark function is applied to the n-th ratio A007305(n+1)/A047679(n-1) in the full Stern-Brocot tree and zero when it results a rational value.

Original entry on oeis.org

0, 0, 0, 5, 5, 0, 0, 0, 2, 2, 0, 5, 5, 0, 0, 2, 3, 0, 3, 3, 0, 3, 2, 0, 2, 2, 0, 5, 5, 0, 0, 5, 13, 17, 2, 17, 37, 5, 13, 13, 5, 37, 17, 2, 17, 13, 5, 2, 3, 0, 3, 3, 0, 3, 2, 0, 2, 2, 0, 5, 5, 0, 0, 3, 17, 3, 37, 21, 13, 10, 37, 3, 401, 6, 13, 10, 401, 0, 17, 17, 0, 401, 10, 13, 6, 401, 3, 37
Offset: 1

Views

Author

Antti Karttunen, Dec 07 2001

Keywords

Comments

Note: the underlying function N2Q (see the Maple code) maps natural numbers 1, 2, 3, 4, 5, ..., through all the positive rationals 1/1, 1/2, 2/1, 1/3, 2/3, 3/2, 3/1, 1/4, ... bijectively to the union of positive rationals and quadratic surds.
In his "On Numbers and Games", Conway denotes Minkowski's question mark function with x enclosed in a box.

Examples

			The first few values for this mapping are
  N2Q(1)  = Inverse_of_MinkowskisQMark(1)   = 1,
  N2Q(2)  = Inverse_of_MinkowskisQMark(1/2) = 1/2,
  N2Q(3)  = Inverse_of_MinkowskisQMark(2)   = 2,
  N2Q(4)  = Inverse_of_MinkowskisQMark(1/3) = (3-sqrt(5))/2,
  N2Q(5)  = Inverse_of_MinkowskisQMark(2/3) = (sqrt(5)-1)/2,
  N2Q(6)  = Inverse_of_MinkowskisQMark(3/2) = 3/2,
  N2Q(7)  = Inverse_of_MinkowskisQMark(3)   = 3,
  N2Q(8)  = Inverse_of_MinkowskisQMark(1/4) = 1/3,
  N2Q(9)  = Inverse_of_MinkowskisQMark(2/5) = sqrt(2)-1,
  N2Q(10) = Inverse_of_MinkowskisQMark(3/5) = 2-sqrt(2).
		

References

  • J. H. Conway, On Numbers and Games, 2nd ed. Natick, MA: A. K. Peters, pp. 82-86 (First ed.), 2000.

Crossrefs

a(n) = A065936(A065935(n)). Positions of sqrt(n) in this mapping: A065939.

Programs

  • Maple
    [seq(find_sqrt(N2Q(j)),j=1..512)];
    N2Q := n -> Inverse_of_MinkowskisQMark(A007305(m+1)/A047679(m-1));
    Inverse_of_MinkowskisQMark := proc(r) local x,y,b,d,k,s,i,q; x := numer(r); y := denom(r); if(1 = y) then RETURN(x/y); fi; if(2 = y) then RETURN(x/y); fi; b := []; d := []; k := 0; s := 0; i := 0; while(x <> 0) do q := floor(x/y); if(i > 0) then b := [op(b),q]; d := [op(d),x]; fi; x := 2*(x-(q*y)); if(member(x,d,'k') and (k > 1) and (b[k] <> b[k-1]) and (q <> floor(x/y))) then s := eval_periodic_confrac_tail(list2runcounts(b[k..nops(b)])); b := b[1..(k-1)]; break; fi; i := i+1; od; if(0 = k) then b := b[1..(nops(b)-1)]; b := [op(b),b[nops(b)]]; fi; RETURN(factor(eval_confrac([floor(r),op(list2runcounts([0,op(b)]))],s))); end;
    eval_confrac := proc(c,z) local x,i; x := z; for i in reverse(c) do x := (`if`((0=x),x,(1/x)))+i; od; RETURN(x); end;
    eval_periodic_confrac_tail := proc(c) local x,i,u,r; x := (eval_confrac(c,u) - u) = 0; r := [solve(x,u)]; RETURN(max(r[1],r[2])); end; # Note: I am not sure if the larger root is always the correct one for the inverse of Minkowski's question mark function. However, whichever root we take, it does not change this sequence, as the integer under the square root is same in both cases. - Antti Karttunen, Aug 26 2006
    list2runcounts := proc(b) local a,p,y,c; if(0 = nops(b)) then RETURN([]); fi; a := []; c := 0; p := b[1]; for y in b do if(y <> p) then a := [op(a),c]; c := 0; p := y; fi; c := c+1; od; RETURN([op(a),c]); end;
    find_sqrt := proc(x) local n,i,y; n := nops(x); if(n < 2) then RETURN(0); fi; if((2 = n) and (`^` = op(0,x)) and (1/2 = op(2,x))) then RETURN(op(1,x)); else for i from 0 to n do y := find_sqrt(op(i,x)); if(y <> 0) then RETURN(y); fi; od; RETURN(0); fi; end; # This returns an integer under the square-root expression in Maple.

Extensions

Description clarified by Antti Karttunen, Aug 26 2006

A065935 Permutation of N induced by the order-preserving bijection QuQR2toQuQR1 on rationals.

Original entry on oeis.org

1, 4, 7, 16, 2, 13, 127, 64, 8, 19, 10, 25, 3, 124, 32767, 256, 32, 67, 34, 9, 79, 40, 5, 49, 6, 223, 112, 247, 31, 4093, 2147483647, 1024, 128, 259, 130, 33, 271, 136, 17, 37, 76, 39, 319, 160, 20, 43, 22, 97, 12, 415, 208, 55, 3583, 1792, 28, 244, 15, 502, 505, 4090
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. N2QuQR2(j) = N2QuQR1(a[j])

Crossrefs

Inverse permutation: A065934. For other needed Maple procedures, follow A065658. Cf. also A065936-A065939.

Programs

  • Maple
    [seq(QuQR2toQuQR1(j),j=1..128)];
    QuQR2toQuQR1 := n -> frac2position_in_0_1_SB_tree(QtoQ0_1(SternBrocotTreeNum(n)/SternBrocotTreeDen(n)));
    QtoQ0_1 := r -> (((2^floor(r))-1)+(frac(r)/2))/(2^floor(r));
Showing 1-5 of 5 results.