login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A216898
a(n) = smallest number k such that both k - n^2 and k + n^2 are primes.
2
2, 4, 7, 14, 21, 28, 43, 52, 67, 86, 111, 150, 149, 180, 201, 232, 267, 312, 329, 366, 411, 446, 487, 532, 587, 654, 705, 742, 787, 852, 911, 972, 1029, 1118, 1185, 1242, 1313, 1372, 1473, 1528, 1603, 1692, 1769, 1852, 1941, 2032, 2127, 2212, 2317, 2412, 2503
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
FORMULA
a(n) = A087711(n^2). - T. D. Noe, Sep 19 2012
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
Cf. A087711.
Sequence in context: A057264 A045514 A102957 * A176450 A263345 A181655
KEYWORD
nonn
AUTHOR
Zak Seidov, Sep 19 2012
STATUS
approved