Math::N...siSteps(3)

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

πŸ’– 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 $i needed to reach just factors 2 and 3. πŸ‘‘
lowkey important though: this calculation requires factorizing $i, and in the current code, after the small factors, a hard limit of 2**32 is enforced in the interests of not going into a near-infinite loop πŸ’€ above that, the return is undef. so like… respect the limit bestie, it's there for a reason πŸ™ˆ

🌸 SEE ALSO 🌸

  • Math::NumSeq
  • Math::NumSeq::TotientSteps
  • Math::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