%I #6 Feb 11 2014 19:05:42
%S 2,2,3,17,5,37,7,17859077
%N a(n) = the first prime in the orbit of n under f(n) = n^2 + 1, if it exists; = 0 otherwise.
%C Question: Is a(n) > 0 for all n?
%C a(9) may be equal to 0. - _Michel Marcus_, May 19 2013
%e 4 -> 4^2 + 1 = 17 (prime). So a(4) = 17.
%o (PARI) a(n) = {while(! isprime(n), n = n^2 + 1;); return (n);} \\ _Michel Marcus_, May 19 2013
%Y Cf. A002522.
%K nonn,more
%O 1,1
%A _Joseph L. Pe_, Jan 08 2004
|