Skip to content

SafePrimes ​

The safe primes 5,7,11,23,47,…5, 7, 11, 23, 47, …: primes qq with (q−1)/2(q-1)/2 also prime.

SafePrimesthe prime qq with (q−1)/2(q-1)/2 also prime, an indexed collection of open infinitude.

Domain: Collections

Details
  • A lazy indexed collection, and the mirror image of SophieGermainPrimes (qq is safe iff (q−1)/2(q-1)/2 is Sophie Germain); infinitude is equally open, so Count(SafePrimes)=NaNCount(SafePrimes) = NaN. OEIS A005385.
  • At(SafePrimes,k)At(SafePrimes, k) unranks by scanning forward, testing primality of nn and (n−1)/2(n-1)/2 -- At(SafePrimes,1)=5At(SafePrimes, 1) = 5 (22 is prime).
  • Membership goes through Element: Element(23,SafePrimes)Element(23, SafePrimes) is true (1111 is prime), Element(13,SafePrimes)Element(13, SafePrimes) is false (66 is not prime).

Enumeration

Examples

1 more kept as data, checked against the oracles
About
Examples1
CrosswalkOEIS

See also: Count, At, Element, SophieGermainPrimes, PrimeNumbers