OFFSET
1,1
FORMULA
a(1)=2; a(2)=7; for n>2, a(n)=prime(n)*a(n-1)+a(n-2) [From Zak Seidov, Nov 07 2008]
EXAMPLE
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.
MATHEMATICA
a[1]=2; a[2]=7; a[n_]:=Prime[n]*a[n-1]+a[n-2]; Table[a[n], {n, 20}] [From Zak Seidov, Nov 07 2008]
With[{prs=Prime[Range[20]]}, Numerator[Table[FromContinuedFraction[ Take[ prs, n]], {n, 20}]]] (* Harvey P. Dale, Dec 02 2011 *)
PROG
(PARI) a(n)=if(n<0, 0, contfracpnqn(vector(n, i, prime(i)))[1, 1])
CROSSREFS
KEYWORD
frac,nonn
AUTHOR
EXTENSIONS
More terms from Benoit Cloitre, May 25 2003
STATUS
approved