OFFSET
2,2
EXAMPLE
If n=21 then pi(21)=8 and the rational number is 21/8 = 2+1/(1+1/(1+1/(1+1/2))), which has 5 iterations, so a(21)=5.
MATHEMATICA
a[n_] := Length @ ContinuedFraction[n/PrimePi[n]]; Array[a, 100, 2] (* Amiram Eldar, Oct 11 2020 *)
PROG
(PARI) a(n) = #contfrac(n/primepi(n)); \\ Michel Marcus, Oct 11 2020
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Gordon Ridgard, Oct 02 2020
STATUS
approved
