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-4 of 4 results.

A065939 Position of sqrt(n) in the mapping N2QuQR2 given in A065937.

Original entry on oeis.org

1, 25, 223, 3, 3585, 14847, 30458, 8053063679, 7, 128849018881, 31588351, 134140418588671, 32178205, 129990652, 1318594171818636545920576603798101819391, 15
Offset: 1

Views

Author

Antti Karttunen, Dec 07 2001

Keywords

Crossrefs

a[n] = A065934[A065938[n]].

Programs

  • Maple
    [seq(QuQR1toQuQR2(frac2position_in_0_1_SB_tree(sqrt_n_confrac2binfrac(n))), n=1..40)];

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

Original entry on oeis.org

0, 5, 5, 0, 2, 2, 0, 2, 3, 0, 3, 3, 0, 3, 2, 5, 13, 17, 2, 17, 37, 5, 13, 13, 5, 37, 17, 2, 17, 13, 5, 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, 10, 13, 21, 37, 3, 17, 3, 0, 37, 10, 0, 401, 506, 17, 5, 401, 37, 21610, 730, 5, 1373
Offset: 1

Views

Author

Antti Karttunen, Dec 07 2001

Keywords

Comments

Note: the underlying function N2Qv (see the Maple code) maps natural numbers 1, 2, 3, 4, 5, ..., through all the positive rationals in the open range (0,1): 1/2, 1/3, 2/3, 1/4, 2/5, 3/5, ... bijectively to the union of positive rationals and quadratic surds. A065937 gives similar mapping involving the inverse of the standard Minkowski's question mark function.
Note the symmetry of rows 0; 5,5; 0,2,2,0; 2,3,0,3,3,0,3,2; 5,13,17,2,17,37,5,13,13,5,37,17,2,17,13,5; ... emanating from the symmetry present in A007306.

Examples

			The first few values for this mapping are N2Qv(1) = 1, N2Qv(2) = (sqrt(5)-1)/2, N2Qv(3) = (sqrt(5)+1)/2, N2Qv(4) = 1/2, N2Qv(5) = sqrt(2)/2, N2Qv(6) = sqrt(2), N2Qv(7) = 2, N2Qv(8) = sqrt(2)-1
		

Crossrefs

a(n) = A065937(A065934(n)). Positions of the zeros are given by A065810. Positions of sqrt(n) in this mapping: A065938.

Programs

  • Maple
    [seq(find_sqrt(N2Qv(j)),j=1..512)];
    N2Qv := proc(n) local m; m := n + 2^floor_log_2(n); Inverse_of_Variant_of_MinkowskisQMark(A007305(m+1)/A047679(m-1)); end;
    Inverse_of_Variant_of_MinkowskisQMark := proc(r) local x,y,b,d,k,s,i,q; x := numer(r); y := denom(r); if(y = 2*x) then RETURN(1); 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; if(r < (1/2)) then RETURN(factor(eval_confrac([0,op(list2runcounts(b))],s))); else RETURN(factor(eval_confrac(list2runcounts(b),s))); fi; 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;
    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;

Extensions

Description clarified by Antti Karttunen, Aug 26 2006

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;

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-4 of 4 results.