Math::N...ntSteps(3)
๐ Math::NumSeq::TotientSteps ๐
okay bestie, so this is a page from the User Contributed Perl Documentation โ that's the manual name, it lives in the perl man pages, and honestly? it's kind of iconic. ๐
The module itself is Math::NumSeq::TotientSteps โ count of repeated totients to reach 1. yes. that. ๐ฆ
โจ NAME โจ
Math::NumSeq::TotientSteps โ count of repeated totients to reach 1. periodt. ๐
๐ธ SYNOPSIS ๐ธ
like, the bare minimum to get going:
use Math::NumSeq::TotientSteps;
my $seq = Math::NumSeq::TotientSteps->new;
my ($i, $value) = $seq->next;
that's it. that's the whole vibe. ๐
๐ DESCRIPTION ๐
so the question this answers is: how many times do you gotta hit a number with the totient function before you land on 1? ๐ง and it starts counting from i=1, giving you this little sequence:
0, 1, 2, 2, 3, 2, 3, 3, 3, 3, 4, 3, 4, ...
and like, a concrete example so it clicks โ i=5 goes
5 -> 4 -> 2 -> 1
so value=3 steps. no cap. ๐ฅ
๐ FUNCTIONS ๐
bestie, first the housekeeping: see "FUNCTIONS" in Math::NumSeq for the behaviour that's common to all the sequence classes. shared lore, iykyk. ๐ซถ
$seq = Math::NumSeq::TotientSteps->new ()โ creates and returns you a brand new sequence object. main character energy from the jump. โจ
๐ฎ Random Access ๐ฎ
$value = $seq->ith($i)โ hands you back the count of totient(i) steps it takes to get all the way down to 1. ๐ซ$value = $seq->pred($value)โ returns true if$valueshows up in the sequence, which basically just means a count where"$value >= 0". simple as that. ๐
๐ฆ SEE ALSO ๐ฆ
go read these too, they're the friend group:
Math::NumSeqMath::NumSeq::TotientMath::NumSeq::TotientStepsSumMath::NumSeq::DedekindPsiSteps
๐ HOME PAGE ๐
http://user42.tuxfamily.org/math-numseq/index.html
the house. go visit. ๐ธ
๐ LICENSE ๐
Copyright 2011, 2012, 2013, 2014, 2016, 2019, 2020, 2021 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/.
okay real talk for one sec โ that "WITHOUT ANY WARRANTY" part is not a joke, it's literally in there, so don't come for anyone if it breaks. ๐
and that's the whole page bestie, you ate it. ๐
โจ this was Math::N...ntSteps(3) (yes the man page title really do be abbreviating like that, it's giving truncated ๐), shipping out of perl v5.42.0 and dated 2025-07-25. slay, goodbye, go compute some totients. ๐๐ฆ๐
๐ฆ 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