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.
%I A299691 #12 Mar 04 2018 23:47:05 %S A299691 2,3,89,263,386777,149953319 %N A299691 Smallest prime p that remains prime through exactly n iterations of the function f(x) = (x^2 + 7)/8. %C A299691 Since f(7) = (7^2 + 7)/8 = 7, p=7 remains prime through infinitely many iterations of the function. %e A299691 f(2) = (2^2 + 7)/8 = 11/8 (not a prime), and 2 is the smallest prime, so a(0) = 2. %e A299691 f(3) = (3^2 + 7)/8 = 16/8 = 2 (prime), but (2^2 + 7)/8 = 11/8 (not a prime), so p remains prime through exactly one iteration, and p=3 is the smallest prime for which this is the case, so a(1) = 3. %e A299691 f(89) = (89^2 + 7)/8 = 991 (prime), and f(991) = (991^2 + 7)/8 = 122761 (prime), but f(122761) = (122761^2 + 7)/8 = 1883782891 = 211 * 8927881 (not a prime), so p remains prime through exactly two iterations, and p=89 is the smallest prime for which this is the case, so a(2) = 89. %t A299691 Block[{lim = 10^2, s}, s = Array[Length@ NestWhileList[(#^2 + 7)/8 &, Prime@ #, PrimeQ, 1, lim, -1] /. lim -> 0 &, 10^6]; Array[Prime@ FirstPosition[s, #][[1]] &, Max@ s]] (* _Michael De Vlieger_, Feb 18 2018 *) %o A299691 (PARI) isprimeq(q) = {if (denominator(q) != 1, return (0)); isprime(q);} %o A299691 isok(p, n) = {for (k=1, n, q = (p^2 + 7)/8; if (! isprimeq(q), return (0)); p = q;); q = (p^2 + 7)/8; return (! isprimeq(q));} %o A299691 a(n) = {forprime(p=2, , if (isok(p, n), return (p)););} \\ _Michel Marcus_, Feb 26 2018 %Y A299691 Cf. A118940 (Primes p such that (p^2 + 7)/8 is prime). %K A299691 nonn,hard,more %O A299691 0,1 %A A299691 _Jon E. Schoenfield_, Feb 16 2018