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

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