OFFSET
1,1
COMMENTS
Certain terms are paired (e.g. 11 and 23, 31 and 43) but some terms are stand-alone (e.g. 17, 37) as they are the same distance from both consecutive prime squares. Unknown if this sequence terminates.
LINKS
David A. Corneth, Table of n, a(n) for n = 1..10000
EXAMPLE
11 and 23 are terms because 11 = 3^2 + 2 = 5^2 - 14 and 23 = 3^2 + 14 = 5^2 - 2.
17 is a term because 17 = 3^2 + 8 = 5^2 - 8.
PROG
(PARI) ok(p)={if(p>4 && isprime(p), my(q=precprime(sqrtint(p))); isprime(nextprime(q+1)^2 + q^2 - p), 0)} \\ Andrew Howroyd, Aug 24 2020
(PARI) upto(n) = {q = 3; my(res = List()); forprime(p = 5, nextprime(sqrtint(n)), s = p^2 + q^2; forprime(r = q^2, s/2, if(isprime(s - r), listput(res, r); listput(res, s-r); ) ); q = p; ); Set(res); } \\ David A. Corneth, Aug 24 2020
CROSSREFS
KEYWORD
nonn
AUTHOR
Isaac Walters, Aug 24 2020
EXTENSIONS
Terms a(42) and beyond from Andrew Howroyd, Aug 24 2020
Definition made precise by David A. Corneth, Aug 24 2020
a(32) corrected by David A. Corneth, Aug 25 2020
STATUS
approved