OFFSET
1,1
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
MATHEMATICA
f[n_]:=PrimeQ[2*n+1]&&!PrimeQ[n-2]&&!PrimeQ[n+2]; PrimeNext[n_]:=Module[{k}, k=n+1; While[ !PrimeQ[k], k++ ]; k]; PrimePrev[n_]:=Module[{k}, k=n-1; While[ !PrimeQ[k], k-- ]; k]; lst={}; Do[p=Prime[n]; If[f[p], If[f[PrimePrev[p]]&&f[PrimeNext[p]], AppendTo[lst, p]]], {n, 9!}]; lst
sgpQ[n_]:=Module[{nxt=NextPrime[n], prev=NextPrime[n, -1]}, AllTrue[{2n+1, 2nxt+1, 2prev+1}, PrimeQ]&&!PrimeQ[n+2]&&!PrimeQ[n-2]&&!PrimeQ[nxt+2] && !PrimeQ[nxt-2]&&!PrimeQ[prev+2]&&!PrimeQ[prev-2]]; Select[Prime[ Range[ 400000]], sgpQ] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Feb 21 2017 *)
Select[Partition[Prime[Range[100000]], 5, 1], Min[ Differences[#]]> 2 && AllTrue[ 2*#[[2;; 4]]+1, PrimeQ]&][[All, 3]] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Feb 22 2017 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Vladimir Joseph Stephan Orlovsky, Dec 04 2009
EXTENSIONS
Definition rewritten by Harvey P. Dale, Feb 21 2017
STATUS
approved