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.

A138705 a(n) is the number of terms in the continued fraction of the absolute value of B_{2n}, the (2n)-th Bernoulli number.

Original entry on oeis.org

1, 2, 2, 2, 2, 3, 6, 2, 7, 7, 4, 4, 6, 2, 6, 7, 7, 2, 10, 2, 8, 2, 3, 5, 10, 3, 7, 7, 6, 6, 17, 2, 7, 10, 2, 7, 23, 2, 2, 5, 18, 5, 16, 2, 10, 14, 6, 2, 18, 2, 9, 5, 7, 6, 18, 4, 15, 2, 6, 2, 17, 2, 2, 15, 7, 9, 12, 2, 8, 11, 12, 2, 21, 2, 6, 14, 2, 4, 23, 2
Offset: 0

Views

Author

Leroy Quet, Mar 26 2008

Keywords

Comments

The continued fraction terms being counted include the initial 0, if there is one.

Examples

			The 12th Bernoulli number is -691/2730. Now 691/2730 has the continued fraction 0 + 1/(3 + 1/(1 + 1/(19 + 1/(3 + 1/11)))), which has 6 terms (including the zero). So a(6) = 6.
		

Crossrefs

Programs

  • Mathematica
    Table[Length[ContinuedFraction[Abs[BernoulliB[2*n]]]], {n, 0, 100}] (* Vaclav Kotesovec, Oct 03 2019 *)
  • PARI
    a(n) = #contfrac(abs(bernfrac(2*n))); \\ Jinyuan Wang, Aug 07 2021
    
  • Python
    from sympy import continued_fraction, bernoulli
    def A138705(n): return len(continued_fraction(abs(bernoulli(n<<1)))) # Chai Wah Wu, Apr 14 2023

Extensions

a(8)-a(70) from Lars Blomberg, Mar 16 2012