k_tuple {primes}R Documentation

Prime k-tuples

Description

Use prime k-tuples to create lists of twin primes, cousin primes, prime triplets, and so forth.

Usage

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)

Arguments

min

the lower bound of the sequence.

max

the upper bound of the sequence.

tuple

an integer vector representing the target k-tuple pattern.

Details

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.

The term "third cousin primes" is of the author's coinage. There is no canonical name for that relationship to the author's knowledge.

Value

A list of vectors of prime numbers satisfying the condition of tuple.

Author(s)

Paul Egeler, MS

Examples

# 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


[Package primes version 1.6.0 Index]