OFFSET
1,1
COMMENTS
This is a subsequence of A243780: Primes p for which p^i + 4 is prime for i = 1, 3 and 5.
LINKS
Abhiram R Devesh, Table of n, a(n) for n = 1..141
EXAMPLE
p=7 is in this sequence as p + 4 = 11 (prime), p^3 + 4 = 347 (prime), p^5 + 4 = 16811 (prime), and p^7 + 4 = 823547 (prime).
MAPLE
p := 2:
for n from 1 do
if isprime(p+4) and isprime(p^3+4) and isprime(p^5+4) and isprime(p^7+4) then
print(p) ;
end if;
p := nextprime(p) ;
end do: # R. J. Mathar, Jun 13 2014
MATHEMATICA
Select[Prime[Range[900000]], AllTrue[#^{1, 3, 5, 7}+4, PrimeQ]&] (* Harvey P. Dale, Apr 12 2022 *)
PROG
(Python)
import sympy.ntheory as snt
n=2
while n>1:
....n1=n+4
....n2=((n**3)+4)
....n3=((n**5)+4)
....n4=((n**7)+4)
....##Check if n1 , n2, n3 and n4 are also primes.
....if snt.isprime(n1)== True and snt.isprime(n2)== True and snt.isprime(n3)== True and snt.isprime(n4)== True:
........print(n, n1, n2, n3, n4)
....n=snt.nextprime(n)
CROSSREFS
KEYWORD
nonn
AUTHOR
Abhiram R Devesh, Jun 12 2014
STATUS
approved