%I #25 Jul 03 2016 00:14:42
%S 5,7,17,67,109,127,199,359,389,467,599,647,727,829,877,887,919,947,
%T 1187,1259,1429,1789,1889,1987,1997,2099,2129,2309,2399,2417,2557,
%U 2647,2837,2909,3187,3329,3359,3469,3517,3527,3769,3917,3967,4049,4217,4289,4349,4357,4507,4517,4937,5309,5507,5527,5879,6247,6337
%N Primes p such that p^5 + p^3 + p + 2 is prime.
%H Abhiram R Devesh, <a href="/A243844/b243844.txt">Table of n, a(n) for n = 1..10000</a>
%e p = 5 is in this sequence because p^5 + p^3 + p + 2 = 3257 (prime).
%e p = 7 is in this sequence because p^5 + p^3 + p + 2 = 17159 (prime).
%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)+2
%o ....if snt.isprime(pp) == True:
%o ........print(p,pp)
%K nonn,easy
%O 1,1
%A _Abhiram R Devesh_, Jun 14 2014
|