login
A384187
Primes p such that p + 6, p^2 + 6, p^3 + 6, p^4 + 6 and p^5 + 6 are primes.
1
1361, 70216961, 71317991, 311153281, 371383381, 385230821, 400675721, 466490881, 487757861, 620258761, 818694271, 822486341, 888942491, 898259491, 1102784471, 1423261241, 1443957371, 1623698051, 1628827091, 1729743571, 1831375171, 1837091231, 1904579381, 1978478521, 2070333781
OFFSET
1,1
COMMENTS
This is a subsequence of A023201: primes p such that p + 6 is also prime (sexy primes).
The largest tuple of primes of the form (p, p + m, p^2 + m, p^3 + m,..., p^k + m), where m is a digit from 1 to 9, is the 6-tuple (p, p + 6, p^2 + 6, p^3 + 6, p^4 + 6, p^5 + 6). Indeed, if m is an odd digit, then p must be 2 and the longest tuple is (2, 2+3, 2^2+3, 2^3+3, 2^4+3).
For p > 2 we consider the cases:
If m = 2, it is satisfied that p^2 + 2 == 0 (mod 3) for all p!= 3. In fact, (p, p + 2, p^2 + 2) are prime only if p = 3.
If m = 4, then p^4 + 4 == 0 (mod 5), for all p!= 5. Then the longest tuple is (p, p + 4, p^2 + 4, p^3 + 4), which are the p primes of A243734
If m = 6, then p^6 + 6 == 0 (mod 7), for all p!= 7. Thus, the largest tuple is (p, p + 6, p^2 + 6, p^3 + 6, p^4 + 6, p^5 + 6), where a(n) gives these primes.
If m = 8, then p^2 + 8 == 0 (mod 3) for all p!=3. In fact, (p, p + 8, p^2 + 8) are prime only if p = 3.
MATHEMATICA
Select[Prime[Range[32327000]], AllTrue[#^Range[0, 5]+6, PrimeQ]&] (* The program generates the first 10 terms of the sequence. *) (* Harvey P. Dale, Jun 13 2025 *)
PROG
(Python)
from sympy import isprime, primerange
lim = 10**9
A384187 = []
for p in primerange(2, lim):
if isprime(p + 6) and isprime(p**2 + 6) and isprime(p**3 + 6) and isprime(p**4 + 6) and isprime(p**5 + 6):
A384187.append(p)
print(", ".join(str(p) for p in A384187))
CROSSREFS
Sequence in context: A242458 A223254 A260441 * A265498 A113507 A119521
KEYWORD
nonn
AUTHOR
Gonzalo Martínez, May 21 2025
STATUS
approved