Math::NumSeq::PisanoPeriodSteps -- Fibonacci frequency and Leonardo logarithm
use Math::NumSeq::PisanoPeriodSteps; my $seq = Math::NumSeq::PisanoPeriodSteps->new; my ($i, $value) = $seq->next;
This is the number of times the PisanoPeriod must be applied before reaching an unchanging value.
PisanoPeriod
0, 4, 3, 2, 3, 1, 2, 2, 1, 2, 3, 1, 3, 2, 3, 1, 2, 1, 2, ... starting i=1
As per Fulton and Morris
"On arithmetical functions related to the Fibonacci numbers", Acta Arithmetica, volume 16, 1969, pages 105-110. http://matwbn.icm.edu.pl/ksiazki/aa/aa16/aa1621.pdf
repeatedly applying the PisanoPeriod eventually reaches an m which is unchanging, ie. for which PisanoPeriod(m)==m. For example i=5 goes
PisanoPeriod(5)=20 PisanoPeriod(20)=60 PisanoPeriod(60)=60 PisanoPeriod(120)=120 so value=3 applications until to reach unchanging 120
The unchanging period reached is always of the form
m = 24 * 5^(l-1)
The "l" exponent is the Leonardo logarithm. Option values_type => "log" returns that as the sequence values.
values_type => "log"
0, 1, 1, 1, 2, 1, 1, 1, 1, 2, 2, 1, 1, 1, 2, 1, 1, 1, 1, 2, 1, ... starting i=1
For example the i=5 above ends at m=120=24*5^1 so l-1=1 is l=2 for the sequence value.
See "FUNCTIONS" in Math::NumSeq for behaviour common to all sequence classes.
$seq = Math::NumSeq::PisanoPeriodSteps->new ()
$seq = Math::NumSeq::PisanoPeriodSteps->new (values_type => $str)
Create and return a new sequence object.
$value = $seq->ith($i)
Return the count or logarithm of $i.
$i
Math::NumSeq, Math::NumSeq::Fibonacci
http://user42.tuxfamily.org/math-numseq/index.html
Copyright 2012, 2013, 2014 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.