OFFSET
1,1
EXAMPLE
p = 3, f(p) = 19, f(19) = 419, f(419) = 176819 , and f(176819) = 31265489219 all prime.
MATHEMATICA
Select[Prime[Range[10^7]], AllTrue[Rest[NestList[#^2+3#+1&, #, 4]], PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Apr 12 2018 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Zak Seidov, Nov 11 2014
STATUS
approved