Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

twinprimes

Twin Primes


Description

Generate a list of twin primes between n1 and n2.

Usage

twinPrimes(n1, n2)

Arguments

n1, n2

natural numbers with n1 <= n2.

Details

twinPrimes uses Primes and uses diff to find all twin primes in the given interval.

In double precision arithmetic integers are represented exactly only up to 2^53 - 1, therefore this is the maximal allowed value.

Value

Returnes a nx2-matrix, where nis the number of twin primes found, and each twin tuple fills one row.

See Also

Examples

twinPrimes(1e6+1, 1e6+1001)

numbers

Number-Theoretic Functions

v0.8-1
GPL (>= 3)
Authors
Hans Werner Borchers
Initial release
2021-04-11

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.