prime_count {primes} | R Documentation |
Prime-counting Functions and Estimating the Value of the n-th Prime
Description
Functions for estimating —the number of primes less than
or equal to
—and for estimating the value of
, the n-th
prime number.
Usage
prime_count(n, upper_bound)
nth_prime_estimate(n, upper_bound)
Arguments
n |
an integer. See Details for more information. |
upper_bound |
a logical indicating whether to estimate the lower- or upper bound. |
Details
The prime_count
function estimates the number of primes .
When
upper_bound = FALSE
, it is guaranteed to under-estimate for all
.
When
upper_bound = TRUE
, it holds for all positive .
The nth_prime_estimate
function brackets upper and lower bound values of
the nth prime. It is valid for .
The methods of estimation used here are a few of many alternatives. For further information, the reader is directed to the References section.
Author(s)
Paul Egeler, MS
References
"Prime-counting function" (2020) Wikipedia. https://en.wikipedia.org/wiki/Prime-counting_function#Inequalities (Accessed 26 Jul 2020).