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 A266235 #13 May 10 2021 02:36:05 %S A266235 5,101,677,28901,3422501,4884101,260176901,4784488901,5887492901, %T A266235 7370222501,12898144901,14498568101,24840912101,38514062501, %U A266235 47563248101,56249608901,64014060101,110842384901,123657722501,135755402501,205145584901,279343960901,288680544101 %N A266235 Primes representable as f(f(f(...f(p)...))) where p is a prime and f(x) = x^2 + 1. %C A266235 For p>2, f(x) is applied an even number of times, twice at least. %e A266235 a(2) = f(f(3)) = (3^2 + 1)^2 + 1 = 101. %e A266235 a(3) = f(f(5)) = (5^2 + 1)^2 + 1 = 677. %t A266235 Take[Union@ Flatten[Table[Nest[#^2 + 1 &, Prime@ n, #], {n, 150}] & /@ Range@ 6] /. n_ /; CompositeQ@ n -> Nothing, 23] (* _Michael De Vlieger_, Jan 06 2016 *) %o A266235 (Python) %o A266235 from sympy import isprime %o A266235 a=[] %o A266235 TOP=1000000 %o A266235 for p in range(TOP): %o A266235 if isprime(p): %o A266235 q=p %o A266235 while q<TOP: %o A266235 q = q*q+1 %o A266235 if isprime(q): %o A266235 a.append(q) %o A266235 print(sorted(set(a))) %Y A266235 Cf. A000040, A266233. %K A266235 nonn %O A266235 1,1 %A A266235 _Alex Ratushnyak_, Dec 25 2015