k_tuple | R Documentation |
Use prime k-tuples to create lists of twin primes, cousin primes, prime triplets, and so forth.
k_tuple(min, max, tuple)
sexy_prime_triplets(min, max)
twin_primes(min, max)
cousin_primes(min, max)
sexy_primes(min, max)
third_cousin_primes(min, max)
min |
the lower bound of the sequence. |
max |
the upper bound of the sequence. |
tuple |
an integer vector representing the target k-tuple pattern. |
You can construct your own tuples and generate series of primes using
k_tuple
; however, there are functions that exist for some of the named
relationships. They are listed below.
twin_primes
: represents c(0,2)
.
cousin_primes
: represents c(0,4)
.
third_cousin_primes
: represents c(0,8)
.
sexy_primes
: represents c(0,6)
.
sexy_prime_triplets
: represents c(0,6,12)
. (This relationship is
unique in that p + 18
is guaranteed to be composite.)
The term "third cousin primes" is of the author's coinage. There is no canonical name for that relationship to the author's knowledge.
A list of vectors of prime numbers satisfying the condition of
tuple
.
Paul Egeler, MS
# All twin primes up to 13
twin_primes(2, 13) # Identical to `k_tuple(2, 13, c(0,2))`
## [[1]]
## [1] 3 5
##
## [[2]]
## [1] 5 7
##
## [[3]]
## [1] 11 13
# Some prime triplets
k_tuple(2, 19, c(0,4,6))
## [[1]]
## [1] 7 11 13
##
## [[2]]
## [1] 13 17 19
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.