Math::N...siSteps(3)
π Math::NumSeq::DedekindPsiSteps π
okay bestie, welcome to Math::NumSeq::DedekindPsiSteps, which lives in the User Contributed Perl Documentation corner of the manual-verse π«Ά this is the perl manpage for it, and we're gonna get you fluent, no cap.
β¨ NAME β¨
Math::NumSeq::DedekindPsiSteps β the psi function until 2^x*3^y π
π SYNOPSIS π
use Math::NumSeq::DedekindPsiSteps;
my $seq = Math::NumSeq::DedekindPsiSteps->new;
my ($i, $value) = $seq->next;
that's it, that's the whole vibe check πΈ
π¦ DESCRIPTION π¦
So this sequence is literally counting how many times you have to apply the Dedekind psi function over and over again until you land on a number shaped like 2^x*3^y. iconic behavior honestly β¨
0,0,0,0,1,0,1,0,0,1,1,0,2,1,1,0,1,0,2,1,1,1,1,0,2,2,0,1,2,...
and the psi function itself is giving:
psi(n) = product (p+1) * p^(e-1)
prime factors p^e in n
the tea β on that p+1 is: one copy of each distinct prime in n gets swapped from p to p+1. and because that p+1 is even, the value goes up but the prime factors all come out less than p π so every time you re-apply it, things shrink. keep doing that reduction and eventually you're left with nothing but the primes 2 and 3, in some quantity. periodt π
example time, bestie β i=25 needs 2 whole steps:
psi(25) = (5+1)*5 = 30 = 2*3*5
then
psi(30) = (2+1)*(3+1)*(5+1) = 72 = 2*2*2*3*3
and if i is already all 2s and 3s? then it's considered that no steps are required and the value is 0. for example at i=12=2*2*3 the value is 0 π
π FUNCTIONS π
heads up: see "FUNCTIONS" in Math::NumSeq for the behaviour that's common to all the sequence classes π«Ά
$seq = Math::NumSeq::DedekindPsiSteps->new ()β makes you a fresh new sequence object and hands it back to you. main character entrance, honestly π
β Random Access β
$value = $seq->ith($i)β returns the number of repeated applications of the psi function on$ineeded to reach just factors2and3. π
lowkey important though: this calculation requires factorizing$i, and in the current code, after the small factors, a hard limit of2**32is enforced in the interests of not going into a near-infinite loop π above that, the return isundef. so likeβ¦ respect the limit bestie, it's there for a reason π
πΈ SEE ALSO πΈ
Math::NumSeqMath::NumSeq::TotientStepsMath::NumSeq::DedekindPsiCumulative
π HOME PAGE π
<http://user42.tuxfamily.org/math-numseq/index.html>
go look, it's right there π¦
π 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/>.
and that's the whole page, bestie π
this was perl v5.42.0, dated 2025-07-25, and it's the Math::N...siSteps(3) page from User Contributed Perl Documentation. slay, go factor something β¨π
π¦ where this page comes from
- fedora 43: perl-Math-NumSeq 75-11.fc43 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms