login
Primes r between two consecutive squares of primes p^2 and q^2 such that p^2 + q^2 - r is prime as well.
1

%I #25 Aug 26 2020 09:31:46

%S 11,17,23,31,37,43,61,67,73,97,103,109,127,139,151,163,181,229,277,

%T 313,337,367,433,457,523,541,547,601,613,619,631,643,661,709,727,739,

%U 751,757,769,823,829,883,919,1009,1033,1039,1051,1093,1117,1129,1201,1213,1237,1279

%N Primes r between two consecutive squares of primes p^2 and q^2 such that p^2 + q^2 - r is prime as well.

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

%H David A. Corneth, <a href="/A337359/b337359.txt">Table of n, a(n) for n = 1..10000</a>

%e 11 and 23 are terms because 11 = 3^2 + 2 = 5^2 - 14 and 23 = 3^2 + 14 = 5^2 - 2.

%e 17 is a term because 17 = 3^2 + 8 = 5^2 - 8.

%o (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

%o (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

%K nonn

%O 1,1

%A _Isaac Walters_, Aug 24 2020

%E Terms a(42) and beyond from _Andrew Howroyd_, Aug 24 2020

%E Definition made precise by _David A. Corneth_, Aug 24 2020

%E a(32) corrected by _David A. Corneth_, Aug 25 2020