The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A136207 Primes p such that p-6 or p+6 is prime. 3
 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 131, 137, 151, 157, 163, 167, 173, 179, 191, 193, 197, 199, 223, 227, 229, 233, 239, 251, 257, 263, 269, 271, 277, 283, 307, 311, 313, 317, 331, 337 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,1 COMMENTS Either or both of (p-6) and (p+6) is/are prime. - Harvey P. Dale, Jun 22 2019 LINKS Lei Zhou, Table of n, a(n) for n = 1..10000 Eric Weisstein's World of Math, Sexy Primes. [The definition in this webpage is unsatisfactory, because it defines a "sexy prime" as a pair of primes.- N. J. A. Sloane, Mar 07 2021] Wikipedia, Sexy Primes MATHEMATICA dd = 6; DistancePrimesQ1 = (PrimeQ[ # ] && PrimeQ[ # + dd]) &; DistancePrimesQ2 = (PrimeQ[ # ] && PrimeQ[ # - dd] && (# > dd)) &; DistancePrimesQQ = (DistancePrimesQ1[ # ] || DistancePrimesQ2[ # ]) &; DistancePrimes = Select[Range[ # ], DistancePrimesQQ] &; DistancePrimes[1000] Alternative by Lei Zhou: p = 3; Table[While[p = NextPrime[p]; ! (PrimeQ[p - 6] || PrimeQ[p + 6])]; p, {n, 1, 100}] Select[Prime[Range[3, 100]], AnyTrue[#+{6, -6}, PrimeQ]&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jun 22 2019 *) CROSSREFS Cf. A023201, A046117. Sequence in context: A115232 A332346 A020626 * A020624 A020621 A020630 Adjacent sequences:  A136204 A136205 A136206 * A136208 A136209 A136210 KEYWORD nonn AUTHOR Carlos Alves, Dec 21 2007 STATUS approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified June 16 02:14 EDT 2021. Contains 345055 sequences. (Running on oeis4.)