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
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, 36, 39, 40, 41, 42, 44, 46, 48, 50, 51, 52, 53, 54, 56, 58, 60, 63, 65, 66, 68, 69, 70, 72, 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 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
Simon R. Blackburn, James F. McKee, Constructing k-radius sequences, Jun 30 2010.
FORMULA
{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}.
EXAMPLE
a(1) = 1 because 1+1 = 2 is prime.
a(2) = 2 because 2+1 = 3 is prime, or because 2*2+1 = 5 is prime.
a(3) = 3 because 2*3+1 = 7 is prime.
a(4) = 4 because 4+1 = 5 is prime.
a(5) = 5 because 2*5+1 = 11 is prime.
a(6) = 6 because 6+1 = 7 is prime, or because 2*6+1 = 13 is prime.
7 is not in the sequence because neither 7+1 = 8 nor 2*7+1 = 15 are prime.
MATHEMATICA
fQ[n_] := PrimeQ[n + 1] || PrimeQ[2 n + 1]; Select[ Range@ 128, fQ@# &]
Select[Range[200], Or@@PrimeQ[{#+1, 2#+1}]&] (* Harvey P. Dale, Jun 11 2014 *)
PROG
(PARI) is(n)=isprime(n+1) || isprime(2*n+1) \\ Charles R Greathouse IV, Jun 13 2017
CROSSREFS
Cf. A000040, A005097 (odd primes - 1)/2, A006093 (primes minus 1).
Sequence in context: A288712 A002180 A207333 * A298303 A333635 A364379
KEYWORD
easy,nonn
AUTHOR
Jonathan Vos Post, Jul 01 2010
EXTENSIONS
Corrected and extended the sequence and added the Mathematica coding Robert G. Wilson v, Jul 13 2010
STATUS
approved

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