OFFSET
0,2
COMMENTS
Equivalently: a(1) = 2 and for n >= 2, a(n) is the least integer such that the numerator of the continued fraction [a(1),a(2),...,a(n)] is prime.
These prime numerators, listed in A072999, are the same as the prime denominators in the definition of this sequence A083698. The equivalence comes from the fact that 1/[a1, ..., aN] = [0, a1, ..., aN] for any continued fraction [a1, ..., aN] with a1 != 0. That is, numerators and denominators of the convergents are exchanged when considering the continued fraction with/without integer part, which amounts to inserting or deleting a leading 0.
FORMULA
EXAMPLE
The partial quotients of the continued fraction 2 + 1/(1 + 1/(1 + 1/(2 + 1/(2 + 1/(4 + ...))))) are by definition the coefficients [2, 1, 1, 2, 2, 4, ...]. The convergents of this continued fraction are:
2 = 3/1, 2 + 1/1 = 3 = 3/1, 2 + 1/(1 + 1/1) = 2 + 1/2 = 5/2, ...
Here the primes listed in A072999 appear as numerators (cf. equivalent definition in comments). These primes appear as denominators if the terms [2, 1, 1, 2, 2, 4, ...] are considered as coefficients that appear in the pure fraction 1/(a(1) + 1/(a(2) + 1/...))), with convergents: 1/2, 1/(2 + 1/1) = 1/3, 1/(5/2) = 2/5, etc.
This amounts to including the initial a(0) = 0 for the integer part, which "shifts down into the denominator" the coefficients (2, 1, 1, ...) of the earlier mentioned continued fraction 2 + 1/(...).
MATHEMATICA
Nest[Append[#, Block[{k = 1}, While[! PrimeQ@ Denominator@ FromContinuedFraction@ Append[#, k], k++]; k]] &, {2}, 64] (* Michael De Vlieger, Dec 22 2019 *)
PROG
(PARI) l=1; h=2; print1(h, ", "); while(l<2^512, t=l+h; while(!isprime(t), t+=h); print1(floor(t/h), ", "); l=h; h=t)
(PARI) v=[2]; for(k=1, 70, m=1; while(isprime(contfracpnqn(concat(v, [m]))[1, 1])==0, m++); v=concat(v, [m])); a(n)=if(n<2, 2, v[n]); \\ Benoit Cloitre, Jan 15 2013.
CROSSREFS
KEYWORD
cofr,nonn
AUTHOR
Paul D. Hanna, May 03 2003
EXTENSIONS
Edited by M. F. Hasler, Dec 29 2019, merging information from the duplicate A209270, following an observation by Hans Havermann on the SeqFan list.
Initial a(0) = 0 added by N. J. A. Sloane, Dec 30 2019
STATUS
approved