%I #30 Mar 05 2020 10:37:37
%S 3,5,7,13,19,67,149,179,229,239,241,269,277,307,313,397,401,419,439,
%T 487,569,613,643,701,823,863,887,1051,1289,1319,1489,1609,1693,1783,
%U 1873,1999,2143,2239,2309,2423,2539,2549,2593,2617,2729,2753,2819
%N Primes p such that p*q+2 is prime, where q is next prime after p.
%H Charles R Greathouse IV, <a href="/A051507/b051507.txt">Table of n, a(n) for n = 1..10000</a>
%t Prime[Select[Range[1000], PrimeQ[Prime[#]*Prime[# + 1] + 2] &]]
%t Reap[Do[If[PrimeQ[(p=Prime[k])*Prime[k+1]+2],Sow[p]],{k,1,430}]][[2,1]] (* _Zak Seidov_, Dec 05 2010 *)
%o (Sage) A051507 = list(p for p in primes(10**4) if is_prime(p*next_prime(p)+2)) # _D. S. McNeil_, Dec 04 2010
%o (PARI) p=2;forprime(q=3,1e4,if(isprime(p*q+2),print1(p", ")); p=q) \\ _Charles R Greathouse IV_, May 01 2011
%Y Cf. A048880.
%K nonn,easy
%O 1,1
%A _N. J. A. Sloane_
|