login
Primes p such that p+2 and 2p+1 are also prime.
18

%I #30 Sep 08 2022 08:44:56

%S 3,5,11,29,41,179,191,239,281,419,431,641,659,809,1019,1031,1049,1229,

%T 1289,1451,1481,1931,2129,2141,2339,2549,2969,3299,3329,3359,3389,

%U 3539,3821,3851,4019,4271,4481,5231,5279,5441,5501,5639,5741,5849,6131

%N Primes p such that p+2 and 2p+1 are also prime.

%C Intersection of A001359 and A005384. - _Zak Seidov_, Feb 28 2017

%H T. D. Noe, <a href="/A045536/b045536.txt">Table of n, a(n) for n = 1..1000</a>

%p select(t -> isprime(t) and isprime(t+2) and isprime(2*t+1), [3, seq(t,t=5..10000,6)]); # _Robert Israel_, Feb 28 2017

%t Select[Prime[Range[1000]], PrimeQ[#+2] && PrimeQ[2#+1]&] (* _Vladimir Joseph Stephan Orlovsky_, Mar 30 2011*)

%o (Magma) [p: p in PrimesUpTo(6200) | IsPrime(p+2) and IsPrime(2*p+1)]; // _Vincenzo Librandi_, Apr 08 2013

%o (PARI) is(n)=isprime(n) && isprime(n+2) && isprime(2*n+1) \\ _Charles R Greathouse IV_, Feb 25 2014

%Y Cf. A001359, A005384.

%K nonn,easy

%O 1,1

%A _Thomas Kellar_

%E Corrected by _Jud McCranie_, Dec 30 2000

%E Name changed and incorrect comment and program removed by _T. D. Noe_, Aug 05 2010