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.
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