cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A374235 a(n) is the least number k such that A071866(k) = n, or -1 if no such k exists.

Original entry on oeis.org

1, 2, 4, 68, 46, 221, 757, 5518, 65106, 1293698, 3997147, 4009564363
Offset: 2

Views

Author

Amiram Eldar, Jul 01 2024

Keywords

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.

Crossrefs

Cf. A071866.

Programs

  • 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]
  • 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;}