login
A304904
Greatest prime p such that 2*n^2 - p is prime.
3
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,1
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.
FORMULA
a(n) = n^2 + A304905(n) = A304903(n) + 2*A304905(n).
EXAMPLE
a(6) = 67 because 2*6^2 - 67 = 5 is prime whereas 72 - 71 = 1 is not a prime.
PROG
(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
CROSSREFS
KEYWORD
nonn
AUTHOR
Hugo Pfoertner, May 20 2018
STATUS
approved