Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #14 Jan 16 2018 02:45:45
%S 3,5,19,23,277,751,1549,2851,2963,3089,3463,3511,4057,6067,6619,7873,
%T 9257,10937,11161,11321,11483,12589,13997,15139,25121,25939,26113,
%U 26861,30971,33889,37139,38119,39251,39979,40763,41851,42359,44293,50753,50867,51907,54331,54401,55871,56921,58321,60611,62459
%N Prime p such that p^5 + p^3 + p - 4 and p^5 + p^3 + p + 4 are primes.
%C Intersection of A243898 (Prime p such that p^5 + p^3 + p + 4 is prime) and A243899 (Prime p such that p^5 + p^3 + p - 4 is prime).
%H Abhiram R Devesh, <a href="/A243900/b243900.txt">Table of n, a(n) for n = 1..1000</a>
%e Prime p = 3 is in this sequence as p^5 + p^3 + p + 4 = 277 (prime) and p^5 + p^3 + p - 4 = 269 (prime).
%e Prime p = 5 is in this sequence as p^5 + p^3 + p + 4 = 3259 (prime) and p^5 + p^3 + p - 4 = 3251 (prime).
%t Select[Prime@ Range[10^4], AllTrue[#^5 + #^3 + # + {-4, 4}, PrimeQ] &] (* _Michael De Vlieger_, Jan 15 2018 *)
%o (Python)
%o import sympy.ntheory as snt
%o p=1
%o while p>0:
%o ....p=snt.nextprime(p)
%o ....pp=p+(p**3)+(p**5)-4
%o ....qq=p+(p**3)+(p**5)+4
%o ....if snt.isprime(pp) == True and snt.isprime(qq) == True:
%o ........print(p)
%Y Cf. A243898, A243899.
%K nonn
%O 1,1
%A _Abhiram R Devesh_, Jun 14 2014