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.

Showing 1-3 of 3 results.

A138703 a(n) is the sum of the terms in the continued fraction of the absolute value of B_n, the n-th Bernoulli number.

Original entry on oeis.org

1, 2, 6, 0, 30, 0, 42, 0, 30, 0, 18, 0, 37, 0, 7, 0, 28, 0, 96, 0, 559, 0, 6210, 0, 86617, 0, 1425523, 0, 27298263, 0, 601580913, 0, 15116315788, 0, 429614643067, 0, 13711655205344, 0, 488332318973599, 0, 19296579341940107, 0, 841693047573684421, 0, 40338071854059455479
Offset: 0

Views

Author

Leroy Quet, Mar 26 2008

Keywords

Comments

For all odd n >=3, a(n) = 0.

Examples

			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.
		

Crossrefs

Programs

  • 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 *)
  • 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

Extensions

Extended beyond a(15) by R. J. Mathar, Jul 20 2009
More terms from Jean-François Alcover, Mar 27 2013

A138704 Irregular array read by rows: row n contains the continued fraction terms (in order) for the absolute value of B_{2n}, the (2n)th Bernoulli number.

Original entry on oeis.org

1, 0, 6, 0, 30, 0, 42, 0, 30, 0, 13, 5, 0, 3, 1, 19, 3, 11, 1, 6, 7, 10, 1, 5, 1, 2, 2, 54, 1, 33, 1, 2, 3, 2, 529, 8, 20, 2, 6192, 8, 8, 2, 86580, 3, 1, 19, 3, 11, 1425517, 6, 27298231, 14, 1, 2, 1, 14, 601580873, 1, 9, 15, 2, 7, 6, 15116315767, 10, 1, 5, 1, 2, 2, 429614643061, 6
Offset: 0

Views

Author

Leroy Quet, Mar 26 2008

Keywords

Comments

The number of terms in row n is A138705(n).

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)))). So row 6 is (0,3,1,19,3,11).
		

Crossrefs

Programs

  • Maple
    A138704row := proc(n) local B; B := abs(bernoulli(2*n)) ; numtheory[cfrac](B,20,'quotients') ; end: seq(op(A138704row(n)),n=0..20) ; # R. J. Mathar, Jul 20 2009
  • Mathematica
    Array[ContinuedFraction@ Abs@ BernoulliB[2 #] &, 18, 0] // Flatten (* Michael De Vlieger, Oct 18 2017 *)

Extensions

More terms from R. J. Mathar, Jul 20 2009

A138702 a(n) = number of terms in the continued fraction of the absolute value of B_n, the n-th Bernoulli number.

Original entry on oeis.org

1, 2, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 6, 1, 2, 1, 7, 1, 7, 1, 4, 1, 4, 1, 6, 1, 2, 1, 6, 1, 7, 1, 7, 1, 2, 1, 10, 1, 2, 1, 8, 1, 2, 1, 3, 1, 5, 1, 10, 1, 3, 1, 7, 1, 7, 1, 6, 1, 6, 1, 17, 1, 2, 1, 7, 1, 10, 1, 2, 1, 7, 1, 23, 1, 2, 1, 2, 1, 5, 1, 18, 1, 5, 1, 16, 1, 2, 1, 10, 1, 14, 1, 6, 1, 2, 1, 18, 1, 2, 1
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. (a(n), for all odd n >= 3, is 1.)

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(12) = 6.
		

Crossrefs

Programs

  • PARI
    lcf(x)=local(r);r=1;while(1,x-=floor(x);if(x==0,return(r));x=1/x;r++)
    a(n)=lcf(abs(bernfrac(n))) \\ Franklin T. Adams-Watters, May 14 2010

Extensions

More terms from Franklin T. Adams-Watters, May 14 2010
Showing 1-3 of 3 results.