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”).

Sophie Germain primes p surrounded by Sophie Germain primes.
0

%I #2 Mar 31 2012 12:38:28

%S 2,3,20759,103619,145109,148853,199109,291503,353459,356591,362759,

%T 367733,475523,521831,527123,552059,603191,609809,639839,691979,

%U 726419,810809,812939,825491,940421,980471,998213,1103561,1117793,1132811

%N Sophie Germain primes p surrounded by Sophie Germain primes.

%t PrimeNext[n_]:=Module[{k},k=n+1;While[ !PrimeQ[k],k++ ];k]; PrimePrev[n_]:=Module[{k},k=n-1;While[ !PrimeQ[k],k-- ];k]; f[n_]:=PrimeQ[2*n+1]; lst={};Do[p=Prime[n];If[f[p],If[f[PrimePrev[p]]&&f[PrimeNext[p]],AppendTo[lst,p]]],{n,9!}];lst

%Y Cf. A005384

%K nonn

%O 1,1

%A _Vladimir Joseph Stephan Orlovsky_, Dec 04 2009