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.
2, 7, 41, 13, 4799, 45631, 332576273, 157108359787, 4001045161
Offset: 0
Examples
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.
Programs
-
Maple
V:= Array(0..5): q:= 2: r:= 3: count:= 0: while count < 6 do p:= q; q:= r; r:= nextprime(r); for i from 1 while isprime(p^i+q^i-r^i) do od: if V[i-1] = 0 then V[i-1]:= p; count:= count+1 fi; od: convert(V,list);
-
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
Extensions
a(6) from Michael S. Branicky, Nov 29 2022
a(7) from Daniel Suteu, Jan 04 2023
Comments