OFFSET
1,2
EXAMPLE
a(1) = 1 because (1st prime -1)^2 +1 = (2-1)^2 +1 = 2, a prime; a(2) = 2 because (2nd prime -1)^2 +1 = (3-1)^2 +1 = 5, a prime; a(3) = 3 because (3rd prime -1)^2 +1 = (5-1)^2 +1 = 17, a prime; ... ; a(6) # 6 since (6th prime -1)^2 = (13-1)^2 +1 = 145 = 5*29, which is not a prime; etc.
MATHEMATICA
fQ[n_] := PrimeQ[ (Prime@n - 1)^2 + 1]; Select[ Range@ 335, fQ@# &]
CROSSREFS
KEYWORD
nonn
AUTHOR
Juri-Stepan Gerasimov, Mar 10 2010
EXTENSIONS
Edited, corrected and extended by Robert G. Wilson v, Mar 14 2010
STATUS
approved