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-2 of 2 results.

A036247 Numerator of fraction equal to the continued fraction [ 2, 3, 5, ...prime(n) ].

Original entry on oeis.org

2, 7, 37, 266, 2963, 38785, 662308, 12622637, 290982959, 8451128448, 262275964847, 9712661827787, 398481410904114, 17144413330704689, 806185907954024497, 42744997534894003030, 2522761040466700203267
Offset: 1

Views

Author

Keywords

Examples

			a(2)=7 because 2+1/3 = 7/3.
a(3)=37 because 2+1/(3+1/5) = 37/16.
a(4)=266 because 2+1/(3+1/(5+1/7)) = 266/115.
		

Crossrefs

Cf. A036248 (denominator), A083659.

Programs

  • Mathematica
    a[1]=2;a[2]=7;a[n_]:=Prime[n]*a[n-1]+a[n-2];Table[a[n],{n,20}] (* Zak Seidov, Nov 07 2008 *)
    With[{prs=Prime[Range[20]]},Numerator[Table[FromContinuedFraction[ Take[ prs,n]],{n,20}]]] (* Harvey P. Dale, Dec 02 2011 *)
  • PARI
    a(n)=if(n<0,0,contfracpnqn(vector(n,i, prime(i)))[1,1])

Formula

a(1)=2; a(2)=7; for n>2, a(n)=prime(n)*a(n-1)+a(n-2). - Zak Seidov, Nov 07 2008

Extensions

More terms from Benoit Cloitre, May 25 2003

A292433 a(0) = 0, a(1) = 1; a(n) = prime(a(n-1))*a(n-1) + a(n-2).

Original entry on oeis.org

0, 1, 2, 7, 121, 79988, 81600798165, 182421074243967704954243
Offset: 0

Views

Author

Ilya Gutkovskiy, Dec 08 2017

Keywords

Examples

			+---+-------------+--------------------+-------------------+
| n | a(n)/a(n+1) | Continued fraction |      Comment      |
+---+-------------+--------------------+-------------------+
| 1 |    1/2      | [0; 2]             |   2 = prime(a(1)) |
+---+-------------+--------------------+-------------------+
| 2 |    2/7      | [0; 3, 2]          |   3 = prime(a(2)) |
+---+-------------+--------------------+-------------------+
| 3 |    7/121    | [0; 17, 3, 2]      |  17 = prime(a(3)) |
+---+-------------+--------------------+-------------------+
| 4 |  121/79988  | [0; 661, 17, 3, 2] | 661 = prime(a(4)) |
+---+-------------+--------------------+-------------------+
		

Crossrefs

Programs

  • Mathematica
    RecurrenceTable[{a[0] == 0, a[1] == 1, a[n] == Prime[a[n - 1]] a[n - 1] + a[n - 2]}, a[n], {n, 7}]
Showing 1-2 of 2 results.