A243583 Primes p for which p + 4 and p^3 + 4 are primes.
3, 7, 19, 79, 103, 109, 277, 379, 487, 967, 1489, 1663, 1867, 2857, 3019, 3253, 3613, 3697, 4003, 4783, 4969, 5413, 5437, 5503, 5569, 5647, 5923, 7477, 7669, 7687, 7699, 7789, 7933, 8233, 8779, 9007, 9319, 9547, 9739, 10597, 11257, 11467, 11593, 11827, 12037
Offset: 1
Examples
p = 3 is in this sequence because p + 4 = 7 (prime) and p^3 + 4 = 31 (prime). p = 7 is in this sequence because p + 4 = 11 (prime) and p^3 + 4 = 347 (prime).
Links
- Abhiram R Devesh, Table of n, a(n) for n = 1..1000
Programs
-
PARI
s=[]; forprime(p=2, 20000, if(isprime(p+4) && isprime(p^3+4), s=concat(s, p))); s \\ Colin Barker, Jun 11 2014
-
Python
import sympy.ntheory as snt n=2 while n>1: n1=n+4 n2=((n**3)+4) ##Check if n1 and n2 are also primes. if snt.isprime(n1)== True and snt.isprime(n2)== True: print(n, " , " , n1, " , ", n2) n=snt.nextprime(n)
Comments