A358393 First of three consecutive primes p,q,r such that p*q + p*r - q*r, p*q - p*r + q*r and -p*q + p*r + q*r are all prime.
261977, 496163, 1943101, 2204273, 2502827, 2632627, 2822381, 2878543, 3291593, 3431891, 4122043, 4269679, 5205671, 5224361, 5565139, 6248881, 6600989, 6881291, 7568963, 8181317, 8251277, 8377777, 9005561, 9644911, 10226233, 11096753, 11767801, 12252271, 13197361, 13574489, 13730263, 14064901
Offset: 1
Keywords
Examples
a(1) = 261977 is a term because 261977, 261983 and 262007 are consecutive primes with 261977*261983 + 261977*262007 - 261983*262007 = 68631948349, 261977*261983 - 261977*262007 + 261983*262007 = 68635092433, and -261977*261983 + 261977*262007 + 261983*262007 = 68647667329 prime.
Links
- Robert Israel, Table of n, a(n) for n = 1..2000
Crossrefs
Contained in A054643.
Programs
-
Maple
q:= 2: r:= 3: R:= NULL: count:= 0: while count < 40 do p:= q; q:= r; r:= nextprime(r); s:= p*(q+r)+q*r; if isprime(s-2*p*q) and isprime(s-2*p*r) and isprime(s-2*q*r) then R:= R, p; count:= count+1; fi od: R;
-
Mathematica
f[p_, q_, r_] := PrimeQ[p*q + p*r - q*r] && PrimeQ[p*q - p*r + q*r] && PrimeQ[-p*q + p*r + q*r]; Select[Partition[Prime[Range[10^6]], 3, 1], f @@ # &][[;; , 1]] (* Amiram Eldar, Nov 13 2022 *)
-
Python
from itertools import islice from sympy import isprime, nextprime def agen(): p, q, r = 2, 3, 5 while True: pq, pr, qr = p*q, p*r, q*r if all(isprime(t) for t in [pq+pr-qr, pq-pr+qr, -pq+pr+qr]): yield p p, q, r = q, r, nextprime(r) print(list(islice(agen(), 15))) # Michael S. Branicky, Nov 13 2022