login
A374235
a(n) is the least number k such that A071866(k) = n, or -1 if no such k exists.
0
1, 2, 4, 68, 46, 221, 757, 5518, 65106, 1293698, 3997147, 4009564363
OFFSET
2,2
COMMENTS
The corresponding primes, prime(a(n)), are 2, 3, 7, 337, 199, 1381, 5749, 54217, 815729, 20388583, 67816457, 97253646709, ... .
a(14) > 7.5*10^10, if it is not -1.
MATHEMATICA
seq[len_, max_] := Module[{s = Table[0, len], p1 = 2, c = 0, k = 1, i}, While[c < len && p1 < max, p2 = NextPrime[p1]; i = Length[ContinuedFraction[p2/p1]] - 1; If[i <= len && s[[i]] == 0, c++; s[[i]] = k]; p1 = p2; k++]; s]; seq[9, 10^7]
PROG
(PARI) seq(len, pmax = oo) = {my(s = vector(len), p1 = 2, c = 0, k = 1, i); while(c < len && p1 < pmax, p2 = nextprime(p1+1); i = length(contfrac(p2/p1)) - 1; if(i <= len && s[i] == 0, c++; s[i] = k); p1 = p2; k++); s; }
CROSSREFS
Cf. A071866.
Sequence in context: A361228 A018364 A100603 * A362456 A301818 A054920
KEYWORD
nonn,more
AUTHOR
Amiram Eldar, Jul 01 2024
STATUS
approved