login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Length of continued fraction for prime(n)/n.
6

%I #18 Jan 12 2024 10:04:54

%S 1,2,3,3,2,2,3,4,4,3,4,2,3,2,3,3,3,5,4,5,3,5,6,5,4,5,5,6,4,5,3,4,5,3,

%T 4,3,3,4,5,3,6,4,5,6,6,3,3,7,8,8,5,5,6,6,4,6,7,4,7,5,7,7,5,4,6,4,5,5,

%U 3,3,4,3,3,4,4,3,3,3,3,4,6,4,4,4,3,7,5,5,6,4,6,5,5,4,4,5,3,4,6,7,5,5,5,4,6

%N Length of continued fraction for prime(n)/n.

%H David A. Corneth, <a href="/A107901/b107901.txt">Table of n, a(n) for n = 1..10000</a>

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/ContinuedFraction.html">Continued Fraction</a>.

%F a(n) = A107898(n) - 1.

%e From _David A. Corneth_, Jan 09 2024: (Start)

%e a(10) = 3 as prime(10)/10 = 29/10 whose continued fraction is [2; 1, 9] having length 3

%e a(18) = 5 as prime(18)/18 = 61/18 whose continued fraction is [3; 2, 1, 1, 3] having length 5. (End)

%t A107901[n_]=Length[ContinuedFraction[Prime[n]/n]

%o (PARI) a(n) = #contfrac(prime(n)/n) \\ _David A. Corneth_, Jan 09 2024

%o (PARI) first(n) = my(res = primes(n)); for(i = 1, n, res[i] = #contfrac(res[i]/i)); res \\ _David A. Corneth_, Jan 09 2024

%Y Cf. A107898, A107899, A107900.

%K nonn

%O 1,2

%A _Zak Seidov_, May 26 2005