Skip to content

CousinPrimes ​

The (lesser) cousin primes 3,7,13,19,37,…3, 7, 13, 19, 37, …: primes pp with p+4p+4 also prime.

CousinPrimesthe lesser prime pp of a cousin pair (p,p+4)(p, p+4), an indexed collection of open infinitude.

Domain: Collections

Details
  • A lazy indexed collection; open infinitude (a cousin-prime analogue of the twin-prime conjecture), so Count(CousinPrimes)=NaNCount(CousinPrimes) = NaN. OEIS A023200 (the lesser member).
  • At(CousinPrimes,k)At(CousinPrimes, k) unranks by scanning forward, testing primality of nn and n+4n+4 -- At(CousinPrimes,2)=7At(CousinPrimes, 2) = 7.
  • Membership goes through Element: Element(7,CousinPrimes)Element(7, CousinPrimes) is true (7,117, 11 both prime), Element(11,CousinPrimes)Element(11, CousinPrimes) is false (1515 is not).
  • CousinPrimesCousinPrimes is PrimePairs(4)PrimePairs(4) verbatim.

Enumeration

Examples

Basic #

The first 20 lesser cousin primes, OEIS A023200

live ↗
InTake(CousinPrimes,20)\mathrm{Take}(\mathrm{CousinPrimes}, 20)Out[3,7,13,19,37,43,67,79,97,103,109,127,163,193,223,229,277,307,313,349]\bigl\lbrack3, 7, 13, 19, 37, 43, 67, 79, 97, 103, 109, 127, 163, 193, 223, 229, 277, 307, 313, 349\bigr\rbrack
About
Examples1
CrosswalkOEIS

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