NAME
Math::NumSeq::Primes  prime numbers
SYNOPSIS
use Math::NumSeq::Primes;
my $seq = Math::NumSeq::Primes>new;
my ($i, $value) = $seq>next;
DESCRIPTION
The prime numbers, not divisible by anything except themselves and 1.
2, 3, 5, 7, 11, 13, 17, 19, ...
starting i=1
Currently this is implemented with Math::Prime::XS
generating blocks of primes with a sieve of Eratosthenes. The result is reasonably progressive. On a 32bit system there's a hard limit at 2^31 (though even approaching that takes a long time to calculate).
FUNCTIONS
See "FUNCTIONS" in Math::NumSeq for behaviour common to all sequence classes.
$seq = Math::NumSeq::Primes>new ()

Create and return a new sequence object.
$bool = $seq>pred($value)

Return true if
$value
is a prime.In the current code a hard limit of 2**32 is placed on the
$value
to be checked, in the interests of not going into a nearinfinite loop. $i = $seq>value_to_i_estimate($value)

Return an estimate of the i corresponding to
$value
.$value
can be any size, it's not limited as inpred()
. See "Value to i Estimate" below.
FORMULAS
Value to i Estimate
In the current code the number of count of primes up to value is estimated by the wellknown asymptotic
i ~= value/log(value)
SEE ALSO
Math::NumSeq, Math::NumSeq::TwinPrimes, Math::NumSeq::SophieGermainPrimes, Math::NumSeq::Emirps
Math::Prime::XS, Math::Prime::TiedArray, Math::Prime::FastSieve, Math::Prime::Util
HOME PAGE
http://user42.tuxfamily.org/mathnumseq/index.html
LICENSE
Copyright 2010, 2011, 2012, 2013, 2014 Kevin Ryde
MathNumSeq is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.
MathNumSeq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with MathNumSeq. If not, see <http://www.gnu.org/licenses/>.