Math::N...Perfect(3)

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

πŸ’– NAME πŸ’–

Math::NumSeq::TotientPerfect β€” bestie, it's the sequence where you keep summing totients until you hit 1, and if that whole lil journey adds back up to your starting N... that N is perfect. πŸ’…


✨ SYNOPSIS ✨

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

okay so that's literally the whole vibe. you make the object, you ask for the next one, you get numbers back. slay. πŸ¦‹


🌸 DESCRIPTION 🌸

These are the numbers where you take repeated totients β€” over and over, no stopping β€” until you land on 1, and then you add up every single one of those totient values, and the total is the starting n itself. like the number is its own little destiny. periodt. πŸ‘‘

3, 9, 15, 27, 39, 81, 111, 183, 243, 255, ...

not me doing the math for 15 because it's giving textbook example, and honestly? iconic:

  • totient(15)=8
  • totient(8)=4
  • totient(4)=2
  • totient(1)=1

add them up: 8+4+2+1=15. and that's 15. it ate. 15 is a perfect totient. πŸ’–

⚠️ real talk though β€” the current implementation of next() is merely a search by pred() through all odd integers, which isn't very fast. so like... it works, bestie, but don't be out here expecting lightning speed. it's giving "walking, not sprinting." πŸšΆβ™€οΈπŸ’€

πŸŽ€ FUNCTIONS πŸŽ€

peep "FUNCTIONS" in Math::NumSeq for the behaviour common to all sequence classes. that's the shared lore, iykyk. πŸ“š

  • "$seq = Math::NumSeq::TotientPerfect->new ()" β€” create and return a new sequence object. your fresh new sequence baby, born right here. ✨
  • "$bool = $seq->pred($value)" β€” return true if $value is a perfect totient. yes/no, true/false, vibe check passed or not. 🫢

🌈 SEE ALSO 🌈

  • Math::NumSeq
  • Math::NumSeq::Totient
  • Math::NumSeq::TotientSteps

🧚 HOME PAGE 🧚

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

go peek, bestie, the lore is all there. πŸ’œ


πŸ’… LICENSE πŸ’…

Copyright 2011, 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/>.

πŸ’€ fr fr, no warranty, bestie β€” that's not me being dramatic, that's just the license talking. read it. πŸ“

okay that's the whole page!! πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’…πŸ«Ά

this was Math::N...Perfect(3) from the User Contributed Perl Documentation, perl v5.42.0, dated 2025-07-25 β€” mwah, bye bestie, go sum some totients πŸ’œπŸŒ»β­

πŸ“¦ where this page comes from