Math::N...iodSteps(3)

πŸ“¦
version 75 Β· 2 versions
, in fedora 43

πŸ’– NAME πŸ’–

Math::NumSeq::PisanoPeriodSteps β€” Fibonacci frequency and Leonardo logarithm. It's a Perl module from the User Contributed Perl Documentation, and honestly? It's giving niche-math main character energy and we're obsessed. 🧚


✨ SYNOPSIS ✨

use Math::NumSeq::PisanoPeriodSteps;
my $seq = Math::NumSeq::PisanoPeriodSteps->new;
my ($i, $value) = $seq->next;

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so bestie, here's the vibe: this sequence is the number of times PisanoPeriod has to be applied before you reach a value that just… stops changing. Like, it hits a plateau and refuses to move. Iconic behaviour fr fr.

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>

So the way it works is you keep applying PisanoPeriod over and over, and eventually you land on an m that's unchanging β€” ie. one where PisanoPeriod(m)==m. It's the fixed point, the final form, the settled-down era. πŸ’… 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

🌸 Leonardo Logarithm 🌸

The unchanging period you eventually reach 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 instead.

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. Math girlies, we ate. πŸ“


πŸ’… FUNCTIONS πŸ’…

See "FUNCTIONS" in Math::NumSeq for behaviour common to all sequence classes.

  • $seq = Math::NumSeq::PisanoPeriodSteps->new () β€” spin up a brand new sequence object, no options, just pure vibes.
  • $seq = Math::NumSeq::PisanoPeriodSteps->new (values_type => $str) β€” Create and return a new sequence object, this time with values_type set however you like.

πŸŽ€ Random Access πŸŽ€

  • $value = $seq->ith($i) β€” Return the count or logarithm of $i. Yes, you can just ask for any index directly. No cap.

πŸ‘‘ SEE ALSO πŸ‘‘

Math::NumSeq, Math::NumSeq::Fibonacci


🌈 HOME PAGE 🌈

<http://user42.tuxfamily.org/math-numseq/index.html>


πŸ’œ LICENSE πŸ’œ

Copyright 2012, 2013, 2014, 2016, 2019, 2020 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/>.

Quick note bestie: that "WITHOUT ANY WARRANTY" bit is doing heavy lifting β€” it literally means no promises, so don't come for anyone if it misbehaves. 🫢

And that's the whole page, periodt. This one was served up by perl v5.42.0, dated 2025-07-25, filed under Math::N...iodSteps(3). Slay, go write some sequences. πŸ’–βœ¨

πŸ“¦ where this page comes from