NAME
Math::NumSeq::AllPrimeFactors -- prime factors of the integers
SYNOPSIS
use Math::NumSeq::AllPrimeFactors;
my $seq = Math::NumSeq::AllPrimeFactors->new;
my ($i, $value) = $seq->next;
DESCRIPTION
This is the prime factors of integers 2, 3, 4, etc
# starting i=1
2, 3, 2, 2, 5, 2, 3, 7, 2, 2, 2, 3, 3, 2, 5, 11, ...
Order
The optional order
parameter (a string) can control the order of the primes of each integer,
"ascending" the default
"descending"
For example desending rearranges the values to
2, 3, 2, 2, 5, 3, 2, 7, 2, 2, 2, 3, 3, 5, 2, 11, ...
The first difference is at 5,3,2 instead of 5,2,3, those 2,3 being the prime factors of 6 either ascending or descending.
Multiplicity
Option multiplicity => "distinct"
can give just one copy of each prime factor. For example with 9=3*3 gives just one value 3 in the sequence instead of two.
2, 3, 2, 5, 2, 3, 7, 2, 3, 2, 5, 11, ...
FUNCTIONS
See "FUNCTIONS" in Math::NumSeq for behaviour common to all sequence classes.
$seq = Math::NumSeq::Digit->new ()
$seq = Math::NumSeq::Digit->new (radix => $r, order => $o)
-
Create and return a new sequence object.
$bool = $seq->pred($value)
-
Return true if
$value
occurs in the sequence, which means$value
is a prime, or foron_values=>'odd'
an odd prime.
SEE ALSO
Math::NumSeq, Math::NumSeq::PrimeFactorCount, Math::NumSeq::AllDigits, Math::NumSeq::SqrtPrimeFactors
HOME PAGE
http://user42.tuxfamily.org/math-numseq/index.html
LICENSE
Copyright 2012 Kevin Ryde
Math-NumSeq 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.
Math-NumSeq 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 Math-NumSeq. If not, see <http://www.gnu.org/licenses/>.