login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A358744
First of three consecutive primes p, q, r such that p + q - r, p^2 + q^2 - r^2 and p^3 + q^3 - r^3 are all prime.
4
13, 29, 137, 521, 577, 691, 823, 1879, 3469, 4799, 8783, 21569, 25453, 26263, 26591, 27529, 27919, 34607, 39509, 45631, 48869, 53653, 56099, 56633, 57641, 63313, 63809, 67733, 68819, 74381, 76031, 76421, 94781, 97187, 98873, 101279, 105683, 110291, 118967, 119569, 119849, 120577, 123737, 128951
OFFSET
1,1
LINKS
EXAMPLE
a(3) = 137 is a term because 137, 139, 149 are consecutive primes and
137^1 + 139^1 - 149^1 = 127,
137^2 + 139^2 - 149^2 = 15889,
and 137^3 + 139^3 - 149^3 = 1949023 are all prime.
MAPLE
R:= NULL: count:= 0: q:= 2: r:= 3:
while count < 100 do
p:= q; q:= r; r:=nextprime(r);
if isprime(p+q-r) and isprime(p^2+q^2-r^2) and isprime(p^3+q^3-r^3) then count:= count+1; R:= R, p fi;
od:
R;
MATHEMATICA
Select[Partition[Prime[Range[13000]], 3, 1], AllTrue[Table[#[[1]]^k + #[[2]]^k - #[[3]]^k, {k, 1, 3}], PrimeQ] &][[;; , 1]] (* Amiram Eldar, Nov 29 2022 *)
PROG
(Python)
from itertools import islice
from sympy import isprime, nextprime
def agen():
p, q, r = 2, 3, 5
while True:
if all(isprime(t) for t in [p+q-r, p**2+q**2-r**2, p**3+q**3-r**3]):
yield p
p, q, r = q, r, nextprime(r)
print(list(islice(agen(), 44))) # Michael S. Branicky, Nov 29 2022
CROSSREFS
Intersection of A358743, A255581 and A358742.
Sequence in context: A209989 A269515 A166272 * A317897 A195878 A013545
KEYWORD
nonn
AUTHOR
J. M. Bergot and Robert Israel, Nov 29 2022
STATUS
approved