login
A390929
Primes p such that, if q,r,s are the next three primes, both p*q*r*s - (p+q+r+s) and p*q*r*s + (p+q+r+s) are primes.
4
2, 3, 2657, 2741, 3769, 7193, 13997, 14561, 17077, 26501, 34721, 36151, 44917, 54983, 56237, 68447, 79979, 80599, 92849, 96167, 97213, 102931, 104959, 109579, 120851, 131783, 137573, 158771, 159389, 176417, 209159, 209381, 213611, 237563, 241079, 241781, 264739, 268267, 278233, 280603, 283277
OFFSET
1,1
LINKS
EXAMPLE
a(3) = 2657 is a term because the four consecutive primes starting with 2657 are 2657, 2659, 2663, 2671, and 2657 * 2659 * 2663 * 2671 - (2657 + 2659 + 2663 + 2671) = 50252184558049 and 2657 * 2659 * 2663 * 2671 + (2657 + 2659 + 2663 + 2671) = 50252184579349 are prime.
MAPLE
q:= 2: r:= 3: s:= 5:
Res:= NULL: count:= 0:
for i from 1 while count < 100 do
p:= q; q:= r; r:= s; s:= nextprime(s);
a:= p*q*r*s; b:= p+q+r+s;
if isprime(a+b) and isprime(a-b) then
count:= count+1; Res:= Res, p
fi
od:
Res;
MATHEMATICA
Select[Partition[Prime[Range[25000]], 4, 1], AllTrue[Times @@ # + {Plus @@ #, -Plus @@ #}, PrimeQ] &][[All, 1]] (* Paolo Xausa, Dec 01 2025 *)
CROSSREFS
Intersection of A390918 and A390930.
Sequence in context: A137321 A066848 A324310 * A125612 A185156 A235935
KEYWORD
nonn
AUTHOR
Will Gosnell and Robert Israel, Nov 24 2025
STATUS
approved