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

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.
Showing 1-2 of 2 results.