OFFSET
1,1
COMMENTS
3*5-2=13; 3*5+2=17, 23*29-6=661; 23*29+6=673...
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
MAPLE
p:= 1: q:= 2: Res:= NULL:
while q < 100000 do
p:= q; q:= nextprime(q);
if isprime(p*q+p-q) and isprime(p*q+q-p) then
Res:= Res, q;
fi
od:
Res; # Robert Israel, May 10 2017
MATHEMATICA
lst={}; Do[pp=Prime[n-1]; p=Prime[n]; d=p-pp; If[PrimeQ[pp*p-d]&&PrimeQ[pp*p+d], AppendTo[lst, p]], {n, 2, 8!}]; lst
pqpQ[{p_, q_}]:=Module[{pq=p*q}, And@@PrimeQ[{pq+p-q, pq-p+q}]]; Transpose[ Select[Partition[Prime[Range[4000]], 2, 1], pqpQ]][[2]] (* Harvey P. Dale, May 20 2012 *)
PROG
(PARI) is(n)=my(p); isprime(n) && isprime((p=precprime(n-1))*n+p-n) && isprime(p*n-p+n) \\ Charles R Greathouse IV, May 10 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Vladimir Joseph Stephan Orlovsky, Jan 11 2009
EXTENSIONS
Edited by Omar E. Pol, Jan 12 2009
STATUS
approved