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.

A304904 Greatest prime p such that 2*n^2 - p is prime.

Original entry on oeis.org

5, 13, 29, 47, 67, 79, 109, 157, 197, 239, 283, 331, 389, 443, 509, 571, 643, 719, 797, 877, 937, 1051, 1129, 1237, 1321, 1453, 1549, 1669, 1789, 1879, 2029, 2161, 2309, 2447, 2579, 2731, 2857, 3037, 3187, 3359, 3517
Offset: 2

Views

Author

Hugo Pfoertner, May 20 2018

Keywords

Comments

Each square > 1 can be written as the average of 2 primes p1 < p2. a(n) gives the greatest prime p2 such that n^2 = (p1 + p2) / 2. The corresponding p1 is provided in A304903.

Examples

			a(6) = 67 because 2*6^2 - 67 = 5 is prime whereas 72 - 71 = 1 is not a prime.
		

Crossrefs

Programs

  • PARI
    a304903(n) = forprime(p=3, , if(ispseudoprime(2*n^2-p), return(p)))
    a(n) = 2*n^2-a304903(n) \\ Felix Fröhlich, May 20 2018

Formula

a(n) = n^2 + A304905(n) = A304903(n) + 2*A304905(n).