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.

A059866 Period of the continued fraction for sqrt(2^n-1).

Original entry on oeis.org

2, 4, 2, 8, 2, 12, 2, 20, 2, 12, 2, 164, 2, 40, 2, 40, 2, 1208, 2, 660, 2, 1304, 2, 3056, 2, 2492, 2, 1080, 2, 13004, 2, 10232, 2, 11296, 2, 148736, 2, 56576, 2, 615482, 2, 44448, 2, 64, 2, 2628524, 2, 28219952, 2, 139558, 2, 3067080, 2, 2683626, 2, 90740360, 2, 103050292, 2
Offset: 2

Views

Author

Labos Elemer, Feb 28 2001

Keywords

Examples

			For n=7 and n=8 the continued fractions are [[11], [3, 1, 2, 2, 7, 11, 7, 2, 2, 1, 3, 22]] and [[15], [1, 30]] with periods 12 and 2, respectively.
		

Crossrefs

Programs

  • Maple
    with(numtheory): [seq(nops(cfrac(sqrt(2^k-1),'periodic','quotients')[2]),k=2..30)];
  • Mathematica
    Table[Length@ Last@ ContinuedFraction[Sqrt[2^n - 1]], {n, 2, 56}] (* Michael De Vlieger, Mar 21 2015 *)

Extensions

Corrected and extended by Naohiro Nomoto, Nov 09 2001
a(57)-a(60) from Daniel Suteu, Jan 25 2019

A059927 Period of the continued fraction for sqrt(2^(2n+1)).

Original entry on oeis.org

1, 2, 4, 4, 12, 24, 48, 96, 196, 368, 760, 1524, 3064, 6068, 12168, 24360, 48668, 97160, 194952, 389416, 778832, 1557780, 3116216, 6229836, 12462296, 24923320, 49849604, 99694536, 199394616, 398783628, 797556364, 1595117676, 3190297400, 6380517544, 12761088588, 25522110948, 51044281208, 102088450460, 204177067944, 408353857832, 816708255152
Offset: 0

Views

Author

Labos Elemer, Mar 01 2001

Keywords

Comments

K. R. Matthews (Feb 2007) showed that lim_{n -> oo} a(n)/2^n = 0.7427.... - A.H.M. Smeets, Nov 14 2017

Examples

			For n=5 we look at the square root of 2^11 = 2048, and find that the cycle has length 24. Here is Maple's calculation:  cfrac(sqrt(2048),'periodic','quotients') = [[45],[3,1,12,5,1,1,2,1,2,4,1,21,1,4,2,1,2,1,1,5,12,1,3,90]], the periodic part having length 24.
		

Crossrefs

Cf. A003285, A004171, A059866 (for sqrt(2^n-1)).
Cf. A064932 (for sqrt(3^(2n+1))), A293028 (for sqrt(5^(2n+1))).

Programs

  • Maple
    with(numtheory): [seq(nops(cfrac(sqrt(2^(2*k-1)),'periodic','quotients')[2]),k=1..15)];
  • Mathematica
    Array[Length@ ContinuedFraction[Sqrt[2^(2 # + 1)]][[-1]] &, 15, 0] (* Michael De Vlieger, Oct 09 2017 *)

Formula

a(n) = A003285(A004171(n)). - Michel Marcus, Sep 27 2019

Extensions

More terms from Don Reble, Oct 31 2001
a(32) = 3190297400 from Don Reble, Feb 10 2007
a(33)-a(35) from Keith Matthews (keithmatt(AT)gmail.com), Feb 16 2007, Feb 28 2007
Name clarified by Joerg Arndt, Oct 09 2017
a(36)-a(37) from Chai Wah Wu, Sep 26 2019
a(38)-a(40) from Chai Wah Wu, Sep 30 2019

A293028 Period of the continued fraction for sqrt(5^(2n+1)).

Original entry on oeis.org

1, 5, 31, 153, 745, 3779, 19011, 95121, 475251, 2375759, 11880177, 59406541, 297033919, 1485165459, 7425797777, 37129022423
Offset: 0

Views

Author

A.H.M. Smeets, Sep 28 2017

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Length[Last[ContinuedFraction[Sqrt[5^(2n+1)] ]]],{n,0,11}] (* Metin Sariyar, Sep 25 2019 *)

Formula

a(n) = A003285(A013710(n)). - Michel Marcus, Sep 25 2019

Extensions

a(11)-a(13) from Daniel Suteu, Jan 24 2019
Better name from Daniel Suteu, Jan 24 2019
a(14)-a(15) from Chai Wah Wu, Sep 25 2019

A294226 Length of period of continued fraction expansion of sqrt(3*2^n).

Original entry on oeis.org

2, 2, 2, 2, 2, 4, 4, 8, 8, 12, 16, 32, 36, 60, 72, 128, 136, 244, 292, 508, 576, 972, 1120, 1992, 2272, 3948, 4588, 7924, 9056, 15764, 18132, 31832, 36444, 63216, 72808, 126456, 145332, 253112, 290968, 507096, 581952, 1012312, 1163452, 2026504, 2327844, 4051424, 4656388
Offset: 0

Views

Author

A.H.M. Smeets, Oct 25 2017

Keywords

Comments

Lim {n->inf} a(2n)/2^n = 0.555...
Lim {n->inf} a(2n+1)/2^n = 0.966...
It seems that Lim {n->inf} a(2n+1)/a(2n) = sqrt(3).
It seems that Lim {n->inf} a(n)/2^n = (Lim {n -> inf} A064932(n)/3^n)/2.

Crossrefs

Programs

  • Mathematica
    Array[Length@ Last@ ContinuedFraction@ Sqrt[3*2^#] &, 47, 0] (* Michael De Vlieger, Oct 25 2017 *)
  • Python
    # for odd n
    m, p, q = 0, 6, 2
    tl, nl, tb, nb = 3, 1, 2, 1
    while nl < 10**100000000:
        tl = tl * nb + tb * nl
        nl = 2 * nl * nb
        nb = tl
        tb = p * nl
    tl = tl *nb + tb * nl
    nl = 2 * nl * nb
    tel, noe = tl, nl
    while m >= 0:
        tl = tel*q**m
        nl = noe
        a0 = tl//nl
        t = 0
        an = a0
        while an != 2*a0:
            tl = tl - an*nl
            tl, nl = nl, tl
            an = tl//nl
            t = t + 1
        print(2*m+1, t)
        m = m+1

Formula

a(n) = A003285(A007283(n)). - Michel Marcus, Oct 02 2019
Showing 1-4 of 4 results.