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 13 results. Next

A215485 Periods of square root continued fractions at which A013646 sets a new record.

Original entry on oeis.org

0, 1, 2, 3, 7, 9, 13, 19, 23, 27, 35, 41, 43, 45, 53, 55, 71, 77, 101, 127, 129, 135, 147, 163, 169, 189, 199, 201, 247, 283, 335, 353, 367, 459, 465, 503, 537, 587, 625, 637, 643, 739, 767, 827, 1009, 1135, 1325, 1423, 1433, 1543, 1561, 1775, 1781, 1951, 2011
Offset: 0

Views

Author

Patrick McKinley, Aug 12 2012

Keywords

Comments

Each term of this sequence takes a turn at being the smallest unknown period for a square root continued fraction. Periods 1 and 2 are seen as the periods of sqrt(2) and sqrt(3) respectively, but a period of 3 is not seen until sqrt(41).
By convention, the period for perfect squares (e.g., 1) is 0.
Open question: Are there any more even terms after the 2?

Examples

			When a square root continued fraction with a period of 3 is first seen (at sqrt(41)), the lowest period not yet seen is 7, which first occurs as the period of sqrt(58).
		

Crossrefs

Cf. A013646.

A215508 Smallest m such that the period of the continued fraction of sqrt(m) is A215485(n); records of A013646.

Original entry on oeis.org

1, 2, 3, 41, 58, 106, 193, 337, 586, 949, 1061, 1117, 1153, 1249, 1669, 2381, 3733, 5857, 6577, 6781, 8389, 11173, 14293, 15817, 17137, 17209, 23017, 37921, 38377, 46261, 47293, 56929, 82561, 90121, 113173, 122401, 148957, 151057, 161149, 163729, 193873, 206209, 225769, 322513, 497473, 576529, 676129, 686893, 706621, 862921, 946489, 992281, 1032649, 1198081, 1597033, 1655677, 1779409, 1930021, 2299489, 2367481, 2584081, 3209281, 3528409, 3933073, 4068241, 4160521, 4283689, 4726009, 4833901
Offset: 0

Views

Author

Patrick McKinley, Aug 13 2012

Keywords

Comments

The continued fractions of these numbers have the "hard to get" lengths listed in sequence A215485. They fill the last gaps in the table when computing A013646.

Examples

			The lengths of the continued fractions of sqrt(1), sqrt(2), sqrt(3) and sqrt(41) are 0, 1, 2 and 3 respectively. The rest of the sequence follows A215485 similarly.
		

Crossrefs

Formula

a(n) = A013646(A215485(n)). - Pontus von Brömssen, Nov 24 2024

A096491 a(n) = sqrt(n) of n if n is a perfect square, otherwise a(n) = largest term in period of continued fraction expansion of square root of n.

Original entry on oeis.org

1, 2, 2, 2, 4, 4, 4, 4, 3, 6, 6, 6, 6, 6, 6, 4, 8, 8, 8, 8, 8, 8, 8, 8, 5, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 6, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 7, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 8, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16
Offset: 1

Views

Author

Labos Elemer, Jun 29 2004

Keywords

Examples

			For n=127: the period={3,1,2,2,7,11,7,2,2,1,3,22}, max=a(127)=22.
		

Crossrefs

Programs

  • Maple
    A096491 := proc(n)
    if issqr(n) then
    sqrt(n) ;
    else
    numtheory[cfrac](sqrt(n),'periodic','quotients') ;
    %[2] ;
    max(op(%)) ;
    end if;
    end proc:
    # R. J. Mathar, Mar 18 2010
  • Mathematica
    u=1;Do[s=Max[Last[ContinuedFraction[n^(1/2)]]];tc[[u]]=s;u=u+1, {n, 1, m}]

Extensions

Definition revised by N. J. A. Sloane, Mar 18 2010

A096493 Number of distinct primes in continued fraction period of square root of n.

Original entry on oeis.org

0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 2, 1, 1, 1, 1, 0, 0, 0, 1, 2, 1, 1, 2, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 2, 1, 1, 2, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 2, 1, 2, 0, 0, 0, 0, 0, 3, 0, 1, 1, 2, 1, 1, 0, 0, 2, 2, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 2, 1, 1, 1, 0, 3, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0
Offset: 1

Views

Author

Labos Elemer, Jun 29 2004

Keywords

Examples

			n=127: the period={3,1,2,2,7,11,7,2,2,1,3,22},
distinct-primes={2,3,7,11}, so a[127]=4;
		

Crossrefs

Programs

  • Mathematica
    {te=Table[0, {m}], u=1}; Do[s=Count[PrimeQ[Union[Last[ContinuedFraction[n^(1/2)]]]], True]; te[[u]]=s;u=u+1, {n, 1, m}];te
    dpcf[n_]:=Module[{s=Sqrt[n]},If[IntegerQ[s],0,Count[Union[ ContinuedFraction[ s][[2]]],?PrimeQ]]]; Array[dpcf,110] (* _Harvey P. Dale, Mar 18 2016 *)

A096492 Number of distinct terms in continued fraction period of square root of n.

Original entry on oeis.org

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

Views

Author

Labos Elemer, Jun 29 2004

Keywords

Comments

Essentially the same as A028832. - Amiram Eldar, Nov 10 2021

Examples

			n=127: the period={3,1,2,2,7,11,7,2,2,1,3,22},distinct-terms={1,2,3,7,11,22}, so a[127]=6;
		

Crossrefs

Programs

  • Mathematica
    {tc=Table[0, {m}], u=1}; Do[s=Length[Union[Last[ContinuedFraction[n^(1/2)]]]]; tc[[u]]=s;u=u+1, {n, 1, m}], tc

Formula

a(n) = 1 if n is a square and a(n) = A028832(n) otherwise. - Amiram Eldar, Nov 10 2021

A059800 Smallest prime p such that the quotient-cycle length in continued fraction expansion of sqrt(p) is n: smallest prime p(m) for which A054269(m)=n.

Original entry on oeis.org

2, 3, 41, 7, 13, 19, 73, 31, 113, 43, 61, 103, 193, 179, 109, 191, 157, 139, 337, 151, 181, 491, 853, 271, 457, 211, 1109, 487, 821, 379, 601, 463, 613, 331, 1061, 1439, 421, 619, 541, 1399, 1117, 571, 1153, 823, 1249, 739, 1069, 631, 1021, 1051, 1201
Offset: 1

Views

Author

Labos Elemer, Feb 23 2001

Keywords

Examples

			The quotient-cycle length L=9=A054269(m) first appears for p(30)=113, so a(9)=113 namely, at first A054269(30)=9; a(A054269(30)) = p(30) = 113 = a(9). The quotient cycle with L=16 first emerges for sqrt(191) and it is: cfrac(sqrt(191), 'periodic', 'quotients')= [[13],[1,4,1,1,3,2,2,13,2 2,3,1,1,4,1,26]].
		

Crossrefs

Formula

a(n) = Min{p|A054269(sequence number of p)=n; p is prime}.

A062769 Smallest number m such that the continued fraction expansion of sqrt(m) has period 2n + 1.

Original entry on oeis.org

2, 41, 13, 58, 106, 61, 193, 109, 157, 337, 181, 586, 457, 949, 821, 601, 613, 1061, 421, 541, 1117, 1153, 1249, 1069, 1021, 1201, 1669, 2381, 1453, 2137, 2053, 1801, 2293, 1381, 1549, 3733, 3541, 3217, 5857, 1621, 3169, 4657, 2689, 3049, 2389, 4057, 4549
Offset: 0

Views

Author

Lekraj Beedassy, Jul 17 2001

Keywords

Comments

If the continued fraction for sqrt(N) has period (2k + 1) and k-th convergent P(k)/Q(k) [taking P(-1)=1; Q(-1)=0 where necessary], then the i-th positive solution V(i) = [x(i),y(i)] to the Pell equation x^2 - N*y^2 = 1 satisfies the recurrence V(i+2) = 2*A*V(i+1) - V(i) starting with V(0)=(1,0); V(1) = (A,B) where A = 2*S^2 + 1; B = 2*S*T and S = P(k)*Q(k) + P(k-1)*Q(k-1); T = Q(k)^2 + Q(k-1)^2.

Examples

			For n = 2, 2n+1 = 5. a(2) = 13 and we indeed have sqrt(13) = [3; 1, 1, 1, 1, 6] with period 5, the first one in the sequence sqrt(29) = [5; 2, 1, 1, 2, 10], sqrt(53) = [7; 3, 1, 1, 3, 14], sqrt(74) = [8; 1, 1, 1, 1, 16], sqrt(85) = [9; 4, 1, 1, 4, 18], sqrt(89) = [9; 2, 3, 3, 2, 18], ...
		

Crossrefs

Programs

  • Mathematica
    nn = 50; t = Table[0, {nn}]; n = 1; found = 0; While[found < nn, n++; If[! IntegerQ[Sqrt[n]], c = ContinuedFraction[Sqrt[n]]; len = Length[c[[2]]]; If[OddQ[len] && (len + 1)/2 <= nn && t[[(len + 1)/2]] == 0, t[[(len + 1)/2]] = n; found++]]]; t (* T. D. Noe, Apr 04 2014 *)

Extensions

More terms from Naohiro Nomoto, Jan 01 2002

A240072 Least number k with continued fraction of sqrt(k) having periodic part of length 2*n.

Original entry on oeis.org

3, 7, 19, 31, 43, 46, 134, 94, 139, 151, 166, 271, 211, 334, 379, 463, 331, 478, 619, 526, 571, 604, 694, 631, 1051, 751, 886, 1039, 1141, 919, 1291, 1324, 1699, 1879, 1366, 2476, 2038, 1516, 1894, 1759, 2164, 1831, 2179, 1726, 2851, 2461, 2011, 2311, 4603
Offset: 1

Views

Author

T. D. Noe, Apr 04 2014

Keywords

Comments

It appears that, in general, these numbers are less than the corresponding numbers for the odd lengths, A062769.

Examples

			The continued fractions of sqrt(3), sqrt(7), and sqrt(19) are {1; 1, 2}, {2; 1, 1, 1, 4}, and {4; 2, 1, 3, 1, 2, 8}.
		

Crossrefs

Cf. A013646 (even and odd), A062769 (similar, but odd length).

Programs

  • Mathematica
    nn = 50; t = Table[0, {nn}]; n = 1; found = 0; While[found < nn, n++; If[! IntegerQ[Sqrt[n]], c = ContinuedFraction[Sqrt[n]]; len = Length[c[[2]]]; If[EvenQ[len] && len/2 <= nn && t[[len/2]] == 0, t[[len/2]] = n; found++]]]; t

A288184 Least odd number k such that the continued fraction for sqrt(k) has period n.

Original entry on oeis.org

5, 3, 41, 7, 13, 19, 73, 31, 113, 43, 61, 103, 193, 179, 109, 133, 157, 139, 337, 151, 181, 253, 853, 271, 457, 211, 949, 487, 821, 379, 601, 463, 613, 331, 1061, 1177, 421, 619, 541, 589, 1117, 571, 1153, 823, 1249, 739, 1069, 631, 1021, 1051, 1201, 751
Offset: 1

Views

Author

Ilya Gutkovskiy, Jun 06 2017

Keywords

Examples

			a(2) = 3, sqrt(3) = 1 + 1/(1 + 1/(2 + 1/(1 + 1/(2 + 1/...)))), period 2: [1, 2].
		

Crossrefs

Programs

  • Python
    from sympy import continued_fraction_periodic
    def A288184(n):
        d = 1
        while True:
            s = continued_fraction_periodic(0,1,d)[-1]
            if isinstance(s, list) and len(s) == n:
                return d
            d += 2 # Chai Wah Wu, Jun 07 2017

Formula

A003285(a(n)) = n, A000035(a(n)) = 1.

A288185 Least even number k such that the continued fraction for sqrt(k) has period n.

Original entry on oeis.org

2, 6, 130, 14, 74, 22, 58, 44, 106, 86, 298, 46, 746, 134, 1066, 94, 1018, 424, 922, 268, 394, 166, 586, 382, 1306, 214, 1354, 334, 1642, 436, 2122, 508, 1114, 454, 4138, 478, 3194, 1108, 4874, 526, 3418, 724, 2458, 604, 9914, 694, 4618, 844, 2746, 1318
Offset: 1

Views

Author

Ilya Gutkovskiy, Jun 06 2017

Keywords

Examples

			a(2) = 6, sqrt(6) = 2 + 1/(2 + 1/(4 + 1/(2 + 1/(4 + 1/...)))), period 2: [2, 4].
		

Crossrefs

Programs

  • Python
    from sympy import continued_fraction_periodic
    def A288185(n):
        d = 2
        while True:
            s = continued_fraction_periodic(0,1,d)[-1]
            if isinstance(s, list) and len(s) == n:
                return d
            d += 2 # Chai Wah Wu, Jun 08 2017

Formula

A003285(a(n)) = n, A000035(a(n)) = 0.
Showing 1-10 of 13 results. Next