cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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.

This page as a plain text file.
%I A358744 #11 Dec 09 2022 15:43:27
%S A358744 13,29,137,521,577,691,823,1879,3469,4799,8783,21569,25453,26263,
%T A358744 26591,27529,27919,34607,39509,45631,48869,53653,56099,56633,57641,
%U A358744 63313,63809,67733,68819,74381,76031,76421,94781,97187,98873,101279,105683,110291,118967,119569,119849,120577,123737,128951
%N 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.
%H A358744 Robert Israel, <a href="/A358744/b358744.txt">Table of n, a(n) for n = 1..2500</a>
%e A358744 a(3) = 137 is a term because 137, 139, 149 are consecutive primes and
%e A358744 137^1 + 139^1 - 149^1 = 127,
%e A358744 137^2 + 139^2 - 149^2 = 15889,
%e A358744 and 137^3 + 139^3 - 149^3 = 1949023 are all prime.
%p A358744 R:= NULL: count:= 0: q:= 2: r:= 3:
%p A358744 while count < 100 do
%p A358744   p:= q; q:= r; r:=nextprime(r);
%p A358744   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;
%p A358744 od:
%p A358744 R;
%t A358744 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 *)
%o A358744 (Python)
%o A358744 from itertools import islice
%o A358744 from sympy import isprime, nextprime
%o A358744 def agen():
%o A358744     p, q, r = 2, 3, 5
%o A358744     while True:
%o A358744         if all(isprime(t) for t in [p+q-r, p**2+q**2-r**2, p**3+q**3-r**3]):
%o A358744             yield p
%o A358744         p, q, r = q, r, nextprime(r)
%o A358744 print(list(islice(agen(), 44))) # _Michael S. Branicky_, Nov 29 2022
%Y A358744 Intersection of A358743, A255581 and A358742.
%K A358744 nonn
%O A358744 1,1
%A A358744 _J. M. Bergot_ and _Robert Israel_, Nov 29 2022