Skip to content

SexyPrimes ​

The (lesser) sexy primes 5,7,11,13,17,…5, 7, 11, 13, 17, …: primes pp with p+6p+6 also prime.

SexyPrimesthe lesser prime pp of a sexy pair (p,p+6)(p, p+6), an indexed collection of open infinitude.

Domain: Collections

Details
  • A lazy indexed collection; open infinitude, so Count(SexyPrimes)=NaNCount(SexyPrimes) = NaN. OEIS A023201 (the lesser member; named for the Latin \emph{sex}, six).
  • At(SexyPrimes,k)At(SexyPrimes, k) unranks by scanning forward, testing primality of nn and n+6n+6 -- At(SexyPrimes,1)=5At(SexyPrimes, 1) = 5.
  • Membership goes through Element: Element(5,SexyPrimes)Element(5, SexyPrimes) is true (5,115, 11 both prime), Element(7,SexyPrimes)Element(7, SexyPrimes) is true too (7,137,13); Element(9,SexyPrimes)Element(9, SexyPrimes) is false (not prime).
  • SexyPrimesSexyPrimes is PrimePairs(6)PrimePairs(6) verbatim.

Enumeration

Examples

Basic #

The first 20 lesser sexy primes, OEIS A023201

live ↗
InTake(SexyPrimes,20)\mathrm{Take}(\mathrm{SexyPrimes}, 20)Out[5,7,11,13,17,23,31,37,41,47,53,61,67,73,83,97,101,103,107,131]\bigl\lbrack5, 7, 11, 13, 17, 23, 31, 37, 41, 47, 53, 61, 67, 73, 83, 97, 101, 103, 107, 131\bigr\rbrack
About
Examples1
CrosswalkOEIS

See also: Count, At, Element, TwinPrimes, CousinPrimes, PrimePairs