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.

A358745 a(n) is the least prime p that is the first of three consecutive primes p, q, r such that p^i + q^i - r^i is prime for i from 1 to n but not n+1.

This page as a plain text file.
%I A358745 #17 Mar 08 2024 16:04:20
%S A358745 2,7,41,13,4799,45631,332576273,157108359787,4001045161
%N A358745 a(n) is the least prime p that is the first of three consecutive primes p, q, r such that p^i + q^i - r^i is prime for i from 1 to n but not n+1.
%C A358745 For any prime x, if p == r (mod x) and q <> x, or q == r (mod x) and p <> x, p^i + q^i - r^i is not divisible by x.  Thus there is no modular obstruction to the sequence being infinite.
%C A358745 If a(9) exists, then it exceeds 8*10^12. - _Lucas A. Brown_, Mar 08 2024
%e A358745 a(3) = 13 because 13, 17, 19 are consecutive primes with 13 + 17 - 19 = 11, 13^2 + 17^2 - 19^2 = 97 and 13^3 + 17^3 - 19^3 = 251 are prime but 13^4 + 17^4 - 19^4 = -18239 is not, and no prime less than 13 works.
%p A358745 V:= Array(0..5):
%p A358745 q:= 2: r:= 3: count:= 0:
%p A358745 while count < 6 do
%p A358745   p:= q; q:= r; r:= nextprime(r);
%p A358745   for i from 1 while isprime(p^i+q^i-r^i) do od:
%p A358745   if V[i-1] = 0 then V[i-1]:= p; count:= count+1 fi;
%p A358745 od:
%p A358745 convert(V,list);
%o A358745 (PARI) a(n) = my(p=2, q=nextprime(p+1)); forprime(r=nextprime(q+1), oo, my(c=0); for(k=1, oo, if(isprime(p^k + q^k - r^k), c+=1, break)); if(c==n, return(p)); p = q; q = r); \\ _Daniel Suteu_, Jan 04 2023
%Y A358745 Cf. A255581, A358742, A358743, A358744.
%K A358745 nonn,more,hard
%O A358745 0,1
%A A358745 _J. M. Bergot_ and _Robert Israel_, Nov 29 2022
%E A358745 a(6) from _Michael S. Branicky_, Nov 29 2022
%E A358745 a(7) from _Daniel Suteu_, Jan 04 2023