A384181 Primes p such that k! + p or |k! - p| is composite for all k >= 0.
2, 3, 71, 97, 179, 181, 211, 223, 251, 283, 431, 503, 577, 827, 857, 971, 1019, 1021, 1109, 1213, 1249, 1259, 1279, 1289, 1373, 1427, 1429, 1483, 1571, 1609, 1619, 1637, 1699, 1709, 1759, 1801, 2053, 2129, 2141, 2213, 2269, 2281, 2293, 2297, 2339, 2381, 2477, 2503
Offset: 1
Keywords
Examples
71 is in this sequence, since k! + 71 is prime only when k = 2, 5, 9, 14, 22, 43, 53 and 55, but |k! - 71| is composite for such values of k.
Programs
-
Python
from sympy import isprime, primerange, factorial def ok(p): return not any(isprime((fk := factorial(k)) + p) and isprime(abs(fk - p)) for k in range(1, p)) print([p for p in primerange(2, 500) if ok(p)])
Extensions
a(17)-a(23) from Sean A. Irvine, May 28 2025
a(24)-a(48) from Michael S. Branicky, May 29 2025
Comments