Math::NumSeq::LiouvilleFunction -- Liouville function sequence
use Math::NumSeq::LiouvilleFunction; my $seq = Math::NumSeq::LiouvilleFunction->new; my ($i, $value) = $seq->next;
The Liouville function, 1, -1, -1, 0, -1, 1, etc, being
1 if i has an even number of prime factors -1 if i has an odd number of prime factors
The sequence starts from i=1 which is taken to be no prime factors, ie. zero, which is even, hence Liouville function 1. Then i=2 and i=3 are -1 since they have one prime factor (they're primes), and i=4 is value 1 because it's 2*2 which is an even number of prime factors (two 2s).
$seq = Math::NumSeq::LiouvilleFunction->new (key=>value,...)
Create and return a new sequence object.
$value = $seq->ith($i)
Return the Liouville function of $i, being 1 or -1 according to the number of prime factors in $i.
$i
$bool = $seq->pred($value)
Return true if $value occurs in the sequence, which simply means 1 or -1.
$value
Math::NumSeq, Math::NumSeq::MobiusFunction, Math::NumSeq::PrimeFactorCount
http://user42.tuxfamily.org/math-numseq/index.html
Copyright 2010, 2011 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/>.
To install Math::NumSeq, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Math::NumSeq
CPAN shell
perl -MCPAN -e shell install Math::NumSeq
For more information on module installation, please visit the detailed CPAN module installation guide.