OFFSET
1,2
LINKS
David A. Corneth, Table of n, a(n) for n = 1..10000
Eric Weisstein's World of Mathematics, Continued Fraction.
FORMULA
a(n) = A107898(n) - 1.
EXAMPLE
From David A. Corneth, Jan 09 2024: (Start)
a(10) = 3 as prime(10)/10 = 29/10 whose continued fraction is [2; 1, 9] having length 3
a(18) = 5 as prime(18)/18 = 61/18 whose continued fraction is [3; 2, 1, 1, 3] having length 5. (End)
MATHEMATICA
A107901[n_]=Length[ContinuedFraction[Prime[n]/n]
PROG
(PARI) a(n) = #contfrac(prime(n)/n) \\ David A. Corneth, Jan 09 2024
(PARI) first(n) = my(res = primes(n)); for(i = 1, n, res[i] = #contfrac(res[i]/i)); res \\ David A. Corneth, Jan 09 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Zak Seidov, May 26 2005
STATUS
approved