login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A104279 Numbers n such that 2n+1 is prime and 2n-1 is not prime. 3

%I #14 Sep 08 2022 08:45:17

%S 1,5,8,11,14,18,20,23,26,29,33,35,39,41,44,48,50,53,56,63,65,68,74,78,

%T 81,83,86,89,95,98,105,111,113,116,119,125,128,131,134,138,140,146,

%U 153,155,158,165,168,173,176,179,183,186,189,191,194,198,200,204,209,215

%N Numbers n such that 2n+1 is prime and 2n-1 is not prime.

%H Robert Israel, <a href="/A104279/b104279.txt">Table of n, a(n) for n = 1..10000</a>

%e a(1)=1 because 3 is prime and 1 is not prime.

%e a(2)=5 because 11 is prime and 9 is not prime.

%p filter:= n -> isprime(2*n+1) and not isprime(2*n-1):

%p select(filter, [$1..300]); # _Robert Israel_, Apr 27 2020

%t Select[ Range[218], PrimeQ[2# + 1] && !PrimeQ[2# - 1] &] (* _Robert G. Wilson v_, Apr 18 2005 *)

%o (Magma) [n: n in [1..220]| not IsPrime(2*n-1) and IsPrime(2*n+1)] // _Vincenzo Librandi_, Jan 28 2011

%o (PARI) is(n)=isprime(2*n+1) && !isprime(2*n-1) \\ _Charles R Greathouse IV_, Jun 13 2017

%Y Cf. A040040 and others.

%K easy,nonn

%O 1,2

%A _Alexandre Wajnberg_, Apr 17 2005

%E More terms from _Robert G. Wilson v_, Apr 18 2005

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 22:17 EDT 2024. Contains 371964 sequences. (Running on oeis4.)