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!)
A240710 Primes p such that at least one number among p+-6 and p+-12 is also a prime. 3
5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 541, 547, 557, 563 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
The first difference between a(n) and A000040(n+2) is a(97) = 541, while A000040(99) = prime(99) = 523.
The union of A240709 and A240710 is the set of all prime numbers, i.e., A000040.
LINKS
EXAMPLE
For 2, 2+-6 and 2+-12 are all even composite numbers. So 2 is excluded.
For 3, 3+-6 and 3+-12 are all multiples of 3. So 3 is excluded.
For each prime number p between 5 and 521, at least one number among p+-6 and p+-12 is a prime number, thus p is included.
For 523, 523 - 12 = 511 = 7*73, 523 - 6 = 517 = 11*47, 523 + 6 = 529 = 23^2, 523 + 12 = 535 = 5*107. They are all composites, so 523 is excluded.
MATHEMATICA
p = 1; Table[While[p = NextPrime[p]; ok = 0; a1 = p - 12; a2 = p - 6; a3 = p + 6; a4 = p + 12; If[a1 > 0, If[PrimeQ[a1], ok = 1]]; If[a2 > 0, If[PrimeQ[a2], ok = 1]]; If[PrimeQ[a3], ok = 1]; If[PrimeQ[a4], ok = 1]; ok == 0]; p, {n, 100}]
Select[Prime[Range[3, 150]], AnyTrue[#+{-12, -6, 6, 12}, PrimeQ]&] (* Harvey P. Dale, Feb 21 2022 *)
CROSSREFS
Sequence in context: A215848 A175212 A066047 * A115232 A332346 A020626
KEYWORD
nonn,easy
AUTHOR
Lei Zhou, Apr 10 2014
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 March 19 04:58 EDT 2024. Contains 370952 sequences. (Running on oeis4.)