Fast Functions for Prime Numbers
Overview
Fast functions for dealing with prime numbers, such as testing whether a number is prime and generating a sequence 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 nth prime, estimating the number of primes less than or equal to an arbitrary number, computing primorials, prime k-tuples (e.g., twin primes), finding the greatest common divisor and smallest (least) common multiple, testing whether two numbers are coprime, and computing Euler's totient function. Most functions are vectorized for speed and convenience.
Install
Health
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK14 OK2026-04-22
- ERROR13 OK, 1 ERROR2026-04-18
- OK14 OK2026-03-10
Documentation
- Help pages
- 12
- Examples that run
- 100%8 run in a plain check
- Exported functions with examples
- 73%
- Documented parameters
- 91%
- Return-value docs
- 91%
- Help pages citing references
- 17%
Downloads
Repository
- PRs merged (all time)
- 100%
- Median days to close, 50 most recently updated closed issues
- 20
- Median days to close, 50 most recently updated closed PRs
- 6
Stars over time
Forks over time
Issues over time
PRs over time
9 development-tooling and community-health practices detected across 7 families in the upstream repository
Checks run against github.com/ironholds/primes on 2026-10-11.
Show all practicesHide 3 practices
Dependencies
Installing primes adds 1 package (1 with compiled code, 1.8 MB of source tarballs). Heaviest: Rcpp 1.8 MB.
Code & Tests
Datasets
People & History
Previously maintained by Os Keyes (0.1.0 to 1.6.0).
Pick two releases to compare their code metrics.
- RR 4.6.0 released · 2026-04-24
- RR 4.5.0 released · 2025-04-11
- 1.6.1Latest
- RR 4.4.0 released · 2024-04-24
- 1.6.02024-01-09 · diff ↗
- 1.5.22023-12-19 · diff ↗
- unarchivedReturned to CRAN2023-11-08
- 1.5.12023-11-08 · diff ↗
- archivedRemoved from CRAN2023-11-06issues were not corrected despite reminders
- 1.5.0
- RR 4.3.0 released · 2023-04-21
- 1.4.02022-09-12 · diff ↗ ·
removed 3 exports
phi, prime_factors, ruth_aaron_pairsadded 2 exports
Rgcd, Rscm - RR 4.2.0 released · 2022-04-22
- RR 4.1.0 released · 2021-05-18
- 1.1.0
- 1.0.0
Show 8 earlier eventsHide 8 earlier events
- 0.2.02020-07-27 · diff ↗ ·
added 12 exports
cousin_primes, k_tuple, next_prime, prev_prime, prime_factors, primorial_n, primorial_p, ruth_aaron_pairs, sexy_prime_triplets, sexy_primes, third_cousin_primes, twin_primes - RR 4.0.0 released · 2020-04-24
- RR 3.6.0 released · 2019-04-26
- RR 3.5.0 released · 2018-04-23
- RR 3.4.0 released · 2017-04-21
- RR 3.3.0 released · 2016-05-03
- 0.1.02015-06-22
- RR 3.2.0 released · 2015-04-16
Package metadata
- First published
- 2015-06-22
- Total releases
- 10 / 11 yrs
- License
- MIT + file LICENSE OSI
- Minimum R
- ≥ 4.0
- Bundled data
- 0.9 KB / 1 file
- Download size
- 22 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("primes")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-18, which the citation names so these numbers can be found later. More on citing and the projects behind them.