**Authors**: Os Keyes and Paul Egeler

**License**: MIT

This R package has several utility functions for dealing with prime numbers, such as checking for primality and generating prime numbers. Additional functions include:

- finding prime factors and Ruth-Aaron pairs
- finding next and previous prime numbers in the series
- finding or estimating the n
^{th}prime - estimating the number of primes less than or equal to an arbitrary number
- computing primorials
- finding prime k-tuples (e.g., twin primes)
- finding the greatest common divisor and smallest (least) common multiple
- testing whether two numbers are coprime
- computing Eulerâ€™s totient (phi)

The package also provides an R dataset containing the first one thousand primes.

You can install the released version of primes from CRAN with:

And the development version from GitHub with:

This checks which of the first twenty natural numbers are prime:

```
library(primes)
is_prime(1:20)
## [1] FALSE TRUE TRUE FALSE TRUE FALSE TRUE FALSE FALSE FALSE TRUE FALSE TRUE FALSE
## [15] FALSE FALSE TRUE FALSE TRUE FALSE
```

You can also generate all the prime numbers between 101 and 199 with the following: