OFFSET
1,1
EXAMPLE
p = 306167, f(p) = 93738231893, f(f(p)) = 8786856118425842363453, f(f(f(p))) = 77208840445917661077402487029419236950083213 and the 88-digit number f(f(f(f(p)))) are all prime numbers.
MATHEMATICA
Select[Prime[Range[9! ]], PrimeQ[ #^2+4]&&PrimeQ[(#^2+4)^2+4]&&PrimeQ[((#^2+4)^2+4)^2+4]&&PrimeQ[(((#^2+4)^2+4)^2+4)^2+4]&] (* Vladimir Joseph Stephan Orlovsky, Feb 26 2010 *)
p4Q[p_]:=AllTrue[NestList[#^2+4&, p, 4], PrimeQ]; Select[Prime[Range[312*10^5]], p4Q] (* Harvey P. Dale, Nov 20 2023 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Giovanni Resta, Feb 27 2006
STATUS
approved