%I #15 Oct 05 2019 05:02:08
%S 1087,3253,4993,9277,11807,14717,15073,17033,20627,24197,26953,29753,
%T 31883,33023,33637,36473,38113,40387,40897,41843,43403,52057,58153,
%U 62473,66587,67967,70537,83983,99173,99713,102023,108287,117673,124247
%N Primes p such that both p^5 - 6 and p^5 + 6 are prime.
%H David A. Corneth, <a href="/A157256/b157256.txt">Table of n, a(n) for n = 1..4502</a>
%e 1087 is a term as 1087 is prime, 1087^5 - 6 = 1517566463014201 is prime and 1087^5 + 6 = 1517566463014213 is prime.
%t q=5;lst={};Do[p=Prime[n];If[PrimeQ[p^q-q-1]&&PrimeQ[p^q+q+1],AppendTo[lst,p]],{n,5*7!}];lst
%t Select[Prime[Range[12000]],AllTrue[#^5+{6,-6},PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* _Harvey P. Dale_, Oct 04 2019 *)
%o (PARI) is(n) = isprime(n) && isprime(n^5 - 6) && isprime(n^5 + 6) \\ _David A. Corneth_, Oct 04 2019
%K nonn,less
%O 1,1
%A _Vladimir Joseph Stephan Orlovsky_, Feb 26 2009
%E Edited by _David A. Corneth_, Oct 04 2019