OFFSET
0,2
COMMENTS
The continued fraction terms being counted include the initial 0, if there is one.
LINKS
Vaclav Kotesovec, Table of n, a(n) for n = 0..10000
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