OFFSET
0,2
COMMENTS
For all odd n >=3, a(n) = 0.
LINKS
Jinyuan Wang, Table of n, a(n) for n = 0..635
EXAMPLE
The 12th Bernoulli number is -691/2730. Now 691/2730 = the continued fraction 0 + 1/(3 + 1/(1 + 1/(19 + 1/(3 + 1/11)))). So a(12) = 0 + 3 + 1 + 19 + 3 + 11 = 37.
MAPLE
A138701row := proc(n) local B; B := abs(bernoulli(n)) ; numtheory[cfrac](B, 20, 'quotients') ; end: A138703 := proc(n) add(c, c=A138701row(n)) ; end: seq(op(A138703(n)), n=0..80) ; # R. J. Mathar, Jul 20 2009
MATHEMATICA
Table[ ContinuedFraction[ BernoulliB[n] // Abs] // Total, {n, 0, 50}] (* Jean-François Alcover, Mar 27 2013 *)
PROG
(PARI) a(n) = vecsum(contfrac(abs(bernfrac(n)))); \\ Jinyuan Wang, Aug 07 2021
(Python)
from sympy import continued_fraction, bernoulli
def A138703(n): return sum(continued_fraction(abs(bernoulli(n)))) # Chai Wah Wu, Apr 14 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Mar 26 2008
EXTENSIONS
Extended beyond a(15) by R. J. Mathar, Jul 20 2009
More terms from Jean-François Alcover, Mar 27 2013
STATUS
approved