OFFSET
0,2
FORMULA
a(n) = A138703(2*n). - R. J. Mathar, Jul 20 2009
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)))). So a(6) = 0 + 3 + 1 + 19 + 3 + 11 = 37.
MAPLE
A138704row := proc(n) local B; B := abs(bernoulli(2*n)) ; numtheory[cfrac](B, 20, 'quotients') ; end: A138706 := proc(n) add(c, c=A138704row(n)) ; end: seq(op(A138706(n)), n=0..30) ; # R. J. Mathar, Jul 20 2009
MATHEMATICA
Table[Total[ContinuedFraction[Abs[BernoulliB[2n]]]], {n, 0, 25}] (* Harvey P. Dale, Feb 23 2012 *)
PROG
(PARI) a(n) = vecsum(contfrac(abs(bernfrac(2*n)))); \\ Jinyuan Wang, Aug 07 2021
(Python)
from sympy import continued_fraction, bernoulli
def A138706(n): return sum(continued_fraction(abs(bernoulli(n<<1)))) # Chai Wah Wu, Apr 14 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Mar 26 2008
EXTENSIONS
a(7)-a(22) from R. J. Mathar, Jul 20 2009
More terms from Jinyuan Wang, Aug 07 2021
STATUS
approved