OFFSET
2,2
EXAMPLE
a(2) = 1 because 2^2 - 1 = 3 and 2^2 + 1 = 5 are primes.
a(7) = 30 because 7^2 - 30 = 19 and 7^2 + 30 = 79 is the pair with maximum difference. All greater differences lead to at least one composite, i.e., 49 + 32 = 81, 49 - 34 = 15, 49 + 36 = 85, 49 + 38 = 87, 49 - 40 = 9, 49 + 42 = 91 = 7*13, 49 + 44 = 93 = 3*31, 49 + 46 = 95, and 49 - 48 = 1 is not a prime.
PROG
(PARI) a304903(n) = forprime(p=3, , if(ispseudoprime(2*n^2-p), return(p)))
a(n) = n^2 - a304903(n) \\ Felix Fröhlich, May 20 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Hugo Pfoertner, May 20 2018
STATUS
approved