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!)
A179182 Natural numbers n such that n+1 or 2n+1 is prime. 1

%I #15 Feb 24 2022 07:15:44

%S 1,2,3,4,5,6,8,9,10,11,12,14,15,16,18,20,21,22,23,26,28,29,30,33,35,

%T 36,39,40,41,42,44,46,48,50,51,52,53,54,56,58,60,63,65,66,68,69,70,72,

%U 74,75,78,81,82,83,86,88,89,90,95,96,98,99,100,102,105,106,108,111,112,113,114,116,119,120,125,126,128

%N Natural numbers n such that n+1 or 2n+1 is prime.

%H Simon R. Blackburn, James F. McKee, <a href="http://arxiv.org/abs/1006.5812">Constructing k-radius sequences</a>, Jun 30 2010.

%F {n: n such that n+1 is prime or 2*n+1 is prime} = {n: n such that n+1 is in A000040 or 2*n+1 is in A000040}.

%e a(1) = 1 because 1+1 = 2 is prime.

%e a(2) = 2 because 2+1 = 3 is prime, or because 2*2+1 = 5 is prime.

%e a(3) = 3 because 2*3+1 = 7 is prime.

%e a(4) = 4 because 4+1 = 5 is prime.

%e a(5) = 5 because 2*5+1 = 11 is prime.

%e a(6) = 6 because 6+1 = 7 is prime, or because 2*6+1 = 13 is prime.

%e 7 is not in the sequence because neither 7+1 = 8 nor 2*7+1 = 15 are prime.

%t fQ[n_] := PrimeQ[n + 1] || PrimeQ[2 n + 1]; Select[ Range@ 128, fQ@# &]

%t Select[Range[200],Or@@PrimeQ[{#+1,2#+1}]&] (* _Harvey P. Dale_, Jun 11 2014 *)

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

%Y Cf. A000040, A005097 (odd primes - 1)/2, A006093 (primes minus 1).

%K easy,nonn

%O 1,2

%A _Jonathan Vos Post_, Jul 01 2010

%E Corrected and extended the sequence and added the Mathematica coding _Robert G. Wilson v_, Jul 13 2010

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 25 03:15 EDT 2024. Contains 371964 sequences. (Running on oeis4.)