login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A171162
Define Sophie Germain isolated primes to be primes p such that 2p+1 is also prime and so that p-2 and p+2 are not primes. The sequence contains Sophie Germain isolated primes p such that the previous prime to p and the succeeding prime to p are both also Sophie Germain isolated primes.
1
103619, 145109, 291503, 356591, 362759, 367733, 475523, 521831, 527123, 603191, 609809, 691979, 726419, 810809, 812939, 825491, 940421, 998213, 1117793, 1132811, 1231889, 1329143, 1331789, 1433891, 1433903, 1549403, 1623059
OFFSET
1,1
LINKS
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
EXTENSIONS
Definition rewritten by Harvey P. Dale, Feb 21 2017
STATUS
approved