OFFSET
1,2
LINKS
Simon R. Blackburn, James F. McKee, Constructing k-radius sequences, Jun 30 2010.
FORMULA
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
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