login
A089751
a(n) = the first prime in the orbit of n under f(n) = n^2 + 1, if it exists; = 0 otherwise.
0
2, 2, 3, 17, 5, 37, 7, 17859077
OFFSET
1,1
COMMENTS
Question: Is a(n) > 0 for all n?
a(9) may be equal to 0. - Michel Marcus, May 19 2013
EXAMPLE
4 -> 4^2 + 1 = 17 (prime). So a(4) = 17.
PROG
(PARI) a(n) = {while(! isprime(n), n = n^2 + 1; ); return (n); } \\ Michel Marcus, May 19 2013
CROSSREFS
Cf. A002522.
Sequence in context: A341768 A184840 A164022 * A137909 A035796 A049009
KEYWORD
nonn,more
AUTHOR
Joseph L. Pe, Jan 08 2004
STATUS
approved