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.

A010186 Continued fraction for sqrt(125).

Original entry on oeis.org

11, 5, 1, 1, 5, 22, 5, 1, 1, 5, 22, 5, 1, 1, 5, 22, 5, 1, 1, 5, 22, 5, 1, 1, 5, 22, 5, 1, 1, 5, 22, 5, 1, 1, 5, 22, 5, 1, 1, 5, 22, 5, 1, 1, 5, 22, 5, 1, 1, 5, 22, 5, 1, 1, 5, 22, 5, 1, 1, 5, 22, 5, 1, 1, 5, 22, 5, 1, 1, 5, 22, 5, 1, 1, 5
Offset: 0

Views

Author

Keywords

Comments

Periodic with period [5,1,1,5,22] of length 5 (after the initial term). - M. F. Hasler, Sep 09 2011

Crossrefs

Cf. A172074.

Programs

  • Mathematica
    ContinuedFraction[Sqrt[125], 300] (* Vladimir Joseph Stephan Orlovsky, Mar 12 2011 *)
    LinearRecurrence[{0,0,0,0,1},{11,5,1,1,5,22},80] (* or *) PadRight[ {11},80,{22,5,1,1,5}] (* Harvey P. Dale, Oct 05 2016 *)
  • PARI
    default(realprecision,199); contfrac(sqrt(125))  \\ _M. F. Hasler, Sep 09 2011
    
  • PARI
    a(n)=[22, 5, 1, 1, 5][n%5+1]-11*!n  \\ M. F. Hasler, Sep 09 2011
    
  • Python
    from sympy import sqrt
    from sympy.ntheory.continued_fraction import continued_fraction_iterator
    def aupton(nn):
        gen = continued_fraction_iterator(sqrt(125))
        return [next(gen) for i in range(nn+1)]
    print(aupton(74)) # Michael S. Branicky, Nov 05 2021
    
  • Python
    # second version based on linear recurrence
    def a(n): return 11 if n == 0 else [5, 1, 1, 5, 22][(n-1)%5]
    print([a(n) for n in range(75)]) # Michael S. Branicky, Nov 05 2021

Formula

G.f.: (11+5*x+x^2+x^3+5*x^4+11*x^5)/((1-x)*(1+x+x^2+x^3+x^4)). - Bruno Berselli, Sep 10 2011
a(n) = a(n-5) for n >= 6. - Wesley Ivan Hurt, Mar 01 2023