login
A138705
a(n) is the number of terms in the continued fraction of the absolute value of B_{2n}, the (2n)-th Bernoulli number.
6
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,2
COMMENTS
The continued fraction terms being counted include the initial 0, if there is one.
LINKS
EXAMPLE
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.
MATHEMATICA
Table[Length[ContinuedFraction[Abs[BernoulliB[2*n]]]], {n, 0, 100}] (* Vaclav Kotesovec, Oct 03 2019 *)
PROG
(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
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Mar 26 2008
EXTENSIONS
a(8)-a(70) from Lars Blomberg, Mar 16 2012
STATUS
approved