cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A240710 Primes p such that at least one number among p+-6 and p+-12 is also a prime.

Original entry on oeis.org

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
Offset: 1

Views

Author

Lei Zhou, Apr 10 2014

Keywords

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.

Examples

			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.
		

Crossrefs

Programs

  • 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 *)