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.

A071866 Number of elements in the continued fraction for prime(n+1)/prime(n).

Original entry on oeis.org

2, 3, 3, 4, 3, 3, 3, 4, 4, 3, 3, 3, 3, 4, 4, 4, 3, 3, 4, 3, 3, 4, 4, 3, 3, 3, 4, 3, 3, 3, 4, 4, 3, 4, 3, 3, 3, 4, 4, 4, 3, 3, 3, 3, 3, 6, 6, 4, 3, 3, 4, 3, 3, 4, 4, 4, 3, 3, 3, 3, 4, 4, 4, 3, 3, 6, 3, 5, 3, 3, 4, 4, 3, 3, 4, 4, 6, 3, 3, 4, 3, 3, 3, 3, 4, 4, 3, 3, 3, 4, 4, 4, 4, 5, 4, 4, 5, 3, 3, 3, 5, 4, 4, 3, 3
Offset: 1

Views

Author

Benoit Cloitre, Jun 09 2002

Keywords

Examples

			prime(5)/prime(4) = 11/7, 11/7 continued fraction is [1, 1, 1, 3] which contains 4 elements, hence a(4)=4.
		

Crossrefs

Programs

  • Maple
    seq(nops(convert(ithprime(n+1)/ithprime(n),confrac)),n=1..200); # Robert Israel, May 29 2018
  • Mathematica
    Table[Length[ContinuedFraction[Prime[n + 1]/Prime[n]]], {n, 105}] (* Ray Chandler, Sep 18 2005 *)
  • PARI
    a(n) = length(contfrac(prime(n+1)/prime(n)));

Extensions

More terms from Hans Havermann, Jul 06 2002