OFFSET
1,1
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1000
EXAMPLE
For p = 3, p^2 + 2p - 4 = 11, p^2 + 8p - 4 = 29;
for p = 7, p^2 + 2p - 4 = 59, p^2 + 8p - 4 = 101;
for p = 607, p^2 + 2p - 4 = 369659, p^2 + 8p - 4 = 373301.
MAPLE
a:= proc(n) if isprime(n) and isprime(n^2+2*n-4) and isprime(n^2+8*n-4) then n end if end proc: seq(a(n), n = 2 .. 15000); # Emeric Deutsch, Jan 20 2009
MATHEMATICA
Select[Prime[Range[7000]], And@@PrimeQ/@{#^2 + 2 # - 4, #^2 + 8 # - 4}&] (* Vincenzo Librandi, Apr 18 2013 *)
Select[Prime[Range[2000]], AllTrue[#^2-4+{2#, 8#}, PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Apr 29 2018 *)
PROG
(Magma) [p: p in PrimesUpTo(13500) | IsPrime(p^2+2*p-4) and IsPrime(p^2+8*p-4)]; // Vincenzo Librandi, Apr 18 2013
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Vincenzo Librandi, Jan 07 2009
EXTENSIONS
Corrected and extended by Emeric Deutsch, Jan 20 2009
STATUS
approved