OFFSET
0,1
COMMENTS
Note that a(11) = 150 and a(12) = 149. Up to n = 10^6, this is the only case where a(n) > a(n+1). What about general case of a(n) < a(n+1)?
First differences are almost linear with n hence the only case with a(n) > a(n+1) is n = 11. - Zak Seidov, May 19 2014
LINKS
Zak Seidov, Table of n, a(n) for n = 0..10000
EXAMPLE
a(11) = 150 because both 150 - 11^2 = 29 and 150 + 11^2 = 271 are primes.
a(12) = 149 because both 149 - 12^2 = 5 and 149 + 12^2 = 293 are primes.
MATHEMATICA
Table[If[n < 1, 2, m = n^2 + 1; While[!PrimeQ[m - n^2] || !PrimeQ[m + n^2], m = m + 2]; m], {n, 0, 100}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Zak Seidov, Sep 19 2012
STATUS
approved