[go: up one dir, main page]

login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

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
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