OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
a(3) = 71 because the third prime is 5, 2*5^2 + 71 = 121 = 11^2 where 11 is prime, and 71 is the least prime that works.
MAPLE
f:= proc(n) local q;
q:= floor(sqrt(2)*n);
do
q:= nextprime(q);
if isprime(q^2-2*n^2) then return q^2-2*n^2 fi;
od
end proc:
map(f, [seq(ithprime(i), i=1..100)]);
PROG
(PARI) a(n) = my(p=2, q=prime(n), s); while (! (issquare(s=2*q^2+p) && isprime(sqrtint(s))), p = nextprime(p+1)); p; \\ Michel Marcus, Aug 04 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
J. M. Bergot and Robert Israel, Jul 24 2022
STATUS
approved