cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A216898 a(n) = smallest number k such that both k - n^2 and k + n^2 are primes.

Original entry on oeis.org

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

Views

Author

Zak Seidov, Sep 19 2012

Keywords

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

Examples

			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.
		

Crossrefs

Cf. A087711.

Programs

  • 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}]

Formula

a(n) = A087711(n^2). - T. D. Noe, Sep 19 2012