Math::N...ntSteps(3)

๐Ÿ“ฆ
version 75 ยท 2 versions
, in fedora 43

๐Ÿ’– 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 $value shows 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::NumSeq
  • Math::NumSeq::Totient
  • Math::NumSeq::TotientStepsSum
  • Math::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