OFFSET
1,1
COMMENTS
This is the general form : (p-n)/(n+1)=prime and (n+1)*p+n=prime; 'Safe' primes and 'Sophie Germain' primes just one part of this general form; If n=1 then we got 'Safe' primes and 'Sophie Germain' primes.
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
MAPLE
Res:= NULL: count:= 0:
q:= 1:
while count < 100 do
q:= nextprime(q);
if isprime(3*q+2) and isprime(9*q+8)
then Res:= Res, 3*q+2; count:= count+1
fi
od:
Res; # Robert Israel, Mar 07 2018
MATHEMATICA
lst={}; n=2; Do[p=Prime[k]; If[PrimeQ[(p-n)/(n+1)]&&PrimeQ[(n+1)*p+n], AppendTo[lst, p]], {k, 7!}]; lst
PROG
(PARI) lista(nn) = forprime(p=17, nn, if(isprime(3*p+2) && isprime(p\3), print1(p", "))); \\ Altug Alkan, Mar 07 2018
(Magma) [NthPrime(n): n in [5..2*10^3] | IsPrime(NthPrime(n) div 3) and IsPrime(3*NthPrime(n)+2)]; // Vincenzo Librandi, Mar 08 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Vladimir Joseph Stephan Orlovsky, Dec 02 2008
STATUS
approved