Skip to content

primes

Fast Functions for Prime Numbers

v1.6.1 · Feb 4, 2025 · MIT + file LICENSE

Description

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.

Downloads

CRAN

1.1K

Last 30 days

3479th

3.2K

Last 90 days

18.4K

Last year

Trend: +0.3% (30d vs prior 30d)

r2u CRAN

41

Last 30 days

130

Last 90 days

434

Last year

Trend: -22.6% (30d vs prior 30d)

autoCRAN

1

Last 7 days

6

Last 30 days

0

All-time

autoCRAN-only: this name is served only by autoCRAN, so the count is exact.

CRAN Check Status

13 OK
Show all 13 flavors
Flavor Status
r-devel-linux-x86_64-debian-clang OK
r-devel-linux-x86_64-debian-gcc OK
r-devel-linux-x86_64-fedora-clang OK
r-devel-linux-x86_64-fedora-gcc OK
r-devel-windows-x86_64 OK
r-oldrel-macos-arm64 OK
r-oldrel-macos-x86_64 OK
r-oldrel-windows-x86_64 OK
r-patched-linux-x86_64 OK
r-release-linux-x86_64 OK
r-release-macos-arm64 OK
r-release-macos-x86_64 OK
r-release-windows-x86_64 OK

Check History

OK 14 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Apr 22, 2026
ERROR 13 OK · 0 NOTE · 0 WARNING · 1 ERROR · 0 FAILURE Apr 18, 2026
ERROR r-devel-windows-x86_64

whether package can be installed

Installation failed.
See 'd:/Rcompile/CRANpkg/local/4.6/primes.Rcheck/00install.out' for details.
OK 14 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Mar 10, 2026

Reverse Dependencies (2)

imports

Dependency Network

Dependencies Reverse dependencies Rcpp LISTO SFDesign primes

Version History

11 tracked
new 1.6.1 Mar 10, 2026
updated 1.6.1 ← 1.6.0 diff Feb 3, 2025
updated 1.6.0 ← 1.5.2 diff Jan 8, 2024
updated 1.5.2 ← 1.5.1 diff Dec 18, 2023
updated 1.5.1 ← 1.5.0 diff Nov 7, 2023
updated 1.5.0 ← 1.4.0 diff Oct 7, 2023
updated 1.4.0 ← 1.1.0 diff Sep 11, 2022
updated 1.1.0 ← 1.0.0 diff Sep 2, 2020
updated 1.0.0 ← 0.2.0 diff Jul 28, 2020
updated 0.2.0 ← 0.1.0 diff Jul 26, 2020
new 0.1.0 Jun 21, 2015