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-10 of 94 results. Next

A065674 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, 64, 10, 13, 127, 16384, 67, 79, 46, 49, 112, 124, 32767, 1073741824, 2050, 262, 139, 151, 2560, 352, 766, 769, 415, 3583, 232, 244, 505, 4093, 2147483647, 4611686018427387904, 4194307, 32776, 16447, 16639, 1057, 34816, 571, 583, 310
Offset: 1

Views

Author

Antti Karttunen, Nov 22 2001

Keywords

Examples

			The fraction 1/2 is at the root (position 1), 1/4 is the left child of its left child, in the position 4 (when the tree is traversed in left-to-right, breadth-first fashion), while 3/4 is the right child of the right child of the root (pos. 7), 1/8 is at the position 64 (6 steps down the left branch from the root) and 3/8 is the right child of the left child of the root, at the position 10, etc.
		

Crossrefs

Permutation of A065810. Cf. A065658, A065675.

Programs

  • Maple
    QuasiCyclics2_pos_in_0_1_SB_tree := proc(t) local num,den; den := 2^(1+floor_log_2(t)); num := (2*(t-(den/2)))+1; RETURN(frac2position_in_0_1_SB_tree(num/den)); end;
    [seq(QuasiCyclics2_pos_in_0_1_SB_tree(j), j=1..128)]
    # For missing Maple functions follow A065658.

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

A283973 Numbers n such that A007306(n) = A283986(n); positions of zeros in A283988.

Original entry on oeis.org

1, 3, 4, 9, 10, 12, 13, 15, 16, 21, 22, 27, 28, 33, 36, 37, 48, 49, 60, 61, 64, 78, 84, 85, 87, 88, 90, 91, 93, 94, 99, 100, 102, 103, 105, 106, 108, 109, 115, 129, 130, 133, 135, 136, 141, 144, 145, 153, 159, 160, 162, 171, 172, 189, 190, 192, 193, 195, 196, 213, 214, 223, 225, 226, 232, 240, 241, 244, 249, 250, 252, 255, 256
Offset: 1

Views

Author

Antti Karttunen, Mar 21 2017

Keywords

Comments

Equally, numbers n for which A007306(n) = A283987(n), or equally, numbers n for which A283986(n) = A283987(n).
Numbers n such that the binary representations of A002487(n-1) and A002487(n) have no 1-bits in common shared positions.

Crossrefs

Cf. A283974 (complement).

Programs

  • Mathematica
    a[0] = 0; a[1] = 1; a[n_] := If[EvenQ@ n, a[n/2], a[(n - 1)/2] + a[(n + 1)/2]]; Map[Function[n, If[EvenQ@ n, a[n/2], BitOr[a[#], a[# + 1]] &[(n - 1)/2]]], 2 Range[99] - 1] (* Michael De Vlieger, Mar 22 2017 *)
  • PARI
    A(n) = if(n<2, n, if(n%2, A(n\2) + A((n + 1)/2), A(n/2)));
    D(n) = if(n<1, 1, sum(k=0, n, binomial(n + k - 1, 2*k)%2)) /* A007306 */
    for(n=1, 300, if(bitor(A(n - 1), A(n)) == D(n), print1(n,", "))) \\ Indranil Ghosh, Mar 23 2017

A049448 Sum of numerator and denominator of fractions in Farey tree A007305/A007306.

Original entry on oeis.org

1, 2, 3, 4, 5, 5, 7, 8, 7, 6, 9, 11, 10, 11, 13, 12, 9, 7, 11, 14, 13, 15, 18, 17, 13, 14, 19, 21, 18, 17, 19, 16, 11, 8, 13, 17, 16, 19, 23, 22, 17, 19, 26, 29, 25, 24, 27, 23, 16, 17, 25, 30, 27, 29, 34, 31, 23, 22, 29, 31, 26, 23, 25, 20, 13, 9, 15, 20, 19, 23
Offset: 0

Views

Author

Keywords

References

  • J. C. Lagarias, Number Theory and Dynamical Systems, pp. 35-72 of S. A. Burr, ed., The Unreasonable Effectiveness of Number Theory, Proc. Sympos. Appl. Math., 46 (1992). Amer. Math. Soc.

Crossrefs

Subset of A007306. Cf. A049465-A049468.

Formula

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.

A049449 Product of numerator and denominator of fractions in Farey tree A007305/A007306.

Original entry on oeis.org

0, 1, 2, 3, 6, 4, 10, 15, 12, 5, 14, 24, 21, 28, 40, 35, 20, 6, 18, 33, 30, 44, 65, 60, 36, 45, 84, 104, 77, 70, 88, 63, 30, 7, 22, 42, 39, 60, 90, 85, 52, 70, 133, 168, 126, 119, 152, 112, 55, 66, 144, 209, 170, 198, 273, 228, 126, 117, 204, 234, 165, 130, 154, 99, 42, 8
Offset: 0

Views

Author

Keywords

Comments

Sum of reciprocals of each row (n > 1) equals 1/2. E.g., 1/3 + 1/6, 1/4 + 1/10 + 1/15 + 1/12 and so on. The link to cut-the-knot gives credit to Pierre Lamothe for this observation. - Joshua Zucker, May 11 2006

References

  • J. C. Lagarias, Number Theory and Dynamical Systems, pp. 35-72 of S. A. Burr, ed., The Unreasonable Effectiveness of Number Theory, Proc. Sympos. Appl. Math., 46 (1992). Amer. Math. Soc.

Crossrefs

See comment in A119272.

Formula

Extensions

More terms from Megan Wawro (s1095813(AT)cedarville.edu)
More terms from Joshua Zucker, May 11 2006

A057432 Obtained by reading first the numerator then the denominator of fractions in left-hand half of Stern-Brocot tree (A007305/A007306).

Original entry on oeis.org

1, 1, 1, 2, 1, 3, 2, 3, 1, 4, 2, 5, 3, 5, 3, 4, 1, 5, 2, 7, 3, 8, 3, 7, 4, 7, 5, 8, 5, 7, 4, 5, 1, 6, 2, 9, 3, 11, 3, 10, 4, 11, 5, 13, 5, 12, 4, 9, 5, 9, 7, 12, 8, 13, 7, 11, 7, 10, 8, 11, 7, 9, 5, 6, 1, 7, 2, 11, 3, 14, 3, 13, 4, 15, 5, 18, 5, 17, 4, 13, 5, 14, 7, 19, 8, 21, 7, 18, 7, 17, 8, 19, 7
Offset: 0

Views

Author

N. J. A. Sloane, Sep 08 2000

Keywords

Examples

			The tree begins:
                                     1/1
                                     1/2
                  1/3                                   2/3
        1/4                 2/5               3/5                 3/4
    1/5      2/7       3/8       3/7     4/7       5/8       5/7      4/5
  1/6 2/9 3/11 3/10 4/11 5/13 5/12 4/9 5/9 7/12 8/13 7/11 7/10 8/11 7/9 5/6
		

Crossrefs

Related to the Kepler tree A294442 via row permutations given by A088208 or A131271.

Programs

  • Mathematica
    sbt[n_]:=Module[{P,L,Y},P={{1,0},{1,1}};L={{1,1},{0,1}};Y={{1,0},{0,1}}; w[b_]:=Fold[ #1.If[ #2==0,L,P]&,Y,b]; u[a_]:={a[[2,1]]+a[[2,2]],a[[1,1]]+a[[1,2]]}; s[l_]:={l,{Last[l],First[l]}}; Map[s,Map[u,Map[w,Part[Partition[Tuples[{0,1},n],2^(n-1)],1]]]]]
    Flatten[Append[{1,1},Table[Map[First,sbt[i]],{i,1,6}]]] (* Peter Luschny, Apr 27 2009 *)

Extensions

More terms from Alford Arnold, Sep 11 2000
More terms from Joshua Zucker, May 11 2006

A065675 The exponent of 2 in the fractions of the range ]0,1[ Stern-Brocot tree (A007305/A007306) [1/2, 1/3, 2/3, 1/4, 2/5, 3/5, 3/4, 1/5, 2/7, 3/8, 3/7, 4/7, 5/8, 5/7, 4/5, ...].

Original entry on oeis.org

-1, 0, 1, -2, 1, 0, -2, 0, 1, -3, 0, 2, -3, 0, 2, -1, 1, 0, -1, 2, 0, -2, 2, 0, -2, 3, 0, -1, 3, 0, -1, 0, 1, -1, 0, 2, -1, 0, 2, -1, 0, 3, -1, 0, 3, -4, 0, 1, -4, 0, 1, -1, 0, 2, -1, 0, 2, -1, 0, 1, -1, 0, 1, -3, 1, 0, -4, 2, 0, -1, 2, 0, -1, 3, 0, -3, 3, 0, -4, 1, 0, -1, 1, 0, -1, 2, 0, -1, 2, 0, -1, 1, 0, -2, 1, 0, -2, 1, 0, -1, 1, 0, -1, 1, 0, -1, 1, 0
Offset: 1

Views

Author

Antti Karttunen, Nov 22 2001

Keywords

Comments

The exponent is negative when the denominator (A007306) is even. These occur as every third term.

Crossrefs

Programs

  • Maple
    [seq(exp_of_2(SternBrocot0_1frac(j)),j=1..128)];
    SternBrocot0_1frac := proc(n) local m; m := n + 2^floor_log_2(n); SternBrocotTreeNum(m)/SternBrocotTreeDen(m); end;
    exp_of_2 := proc(x) local f,m; f := ifactors(x)[2]; for m in f do if(2 = m[1]) then RETURN(m[2]); fi; od; RETURN(0); end;

A318316 Multiplicative with a(p^e) = 2^A007306(e).

Original entry on oeis.org

1, 2, 2, 4, 2, 4, 2, 8, 4, 4, 2, 8, 2, 4, 4, 8, 2, 8, 2, 8, 4, 4, 2, 16, 4, 4, 8, 8, 2, 8, 2, 16, 4, 4, 4, 16, 2, 4, 4, 16, 2, 8, 2, 8, 8, 4, 2, 16, 4, 8, 4, 8, 2, 16, 4, 16, 4, 4, 2, 16, 2, 4, 8, 32, 4, 8, 2, 8, 4, 8, 2, 32, 2, 4, 8, 8, 4, 8, 2, 16, 8, 4, 2, 16, 4, 4, 4, 16, 2, 16, 4, 8, 4, 4, 4, 32, 2, 8, 8, 16, 2, 8, 2, 16, 8
Offset: 1

Views

Author

Antti Karttunen, Aug 31 2018

Keywords

Crossrefs

Programs

  • PARI
    A002487(n) = { my(a=1, b=0); while(n>0, if(bitand(n, 1), b+=a, a+=b); n>>=1); (b); }; \\ From A002487
    A007306(n) = if(!n,1,A002487(n+n-1));
    A318316(n) = factorback(apply(e -> 2^A007306(e),factor(n)[,2]));
    
  • Python
    from functools import reduce
    from sympy import factorint
    def A318316(n): return 1<Chai Wah Wu, May 18 2023

Formula

a(n) = 2^A318322(n).
a(n) = A318307(A003557(n^2)) = A318307(A003557(n))*A318307(n).

A318322 Additive with a(p^e) = A007306(e).

Original entry on oeis.org

0, 1, 1, 2, 1, 2, 1, 3, 2, 2, 1, 3, 1, 2, 2, 3, 1, 3, 1, 3, 2, 2, 1, 4, 2, 2, 3, 3, 1, 3, 1, 4, 2, 2, 2, 4, 1, 2, 2, 4, 1, 3, 1, 3, 3, 2, 1, 4, 2, 3, 2, 3, 1, 4, 2, 4, 2, 2, 1, 4, 1, 2, 3, 5, 2, 3, 1, 3, 2, 3, 1, 5, 1, 2, 3, 3, 2, 3, 1, 4, 3, 2, 1, 4, 2, 2, 2, 4, 1, 4, 2, 3, 2, 2, 2, 5, 1, 3, 3, 4, 1, 3, 1, 4, 3
Offset: 1

Views

Author

Antti Karttunen, Aug 31 2018

Keywords

Crossrefs

Differs from A122810 for the first time at n=48, where a(48) = 4, while A122810(48) = 5.

Programs

  • PARI
    A002487(n) = { my(a=1, b=0); while(n>0, if(bitand(n, 1), b+=a, a+=b); n>>=1); (b); }; \\ From A002487
    A007306(n) = if(!n,1,A002487(n+n-1));
    A318322(n) = vecsum(apply(e -> A007306(e),factor(n)[,2]));
    
  • Python
    from functools import reduce
    from sympy import factorint
    def A318322(n): return sum(sum(reduce(lambda x,y:(x[0],sum(x)) if int(y) else (sum(x),x[1]),bin((e<<1)-1)[-1:2:-1],(1,0))) for e in factorint(n).values()) # Chai Wah Wu, May 18 2023

Formula

a(n) = A007814(A318316(n)).
Showing 1-10 of 94 results. Next