Math::N...Perfect(3)
π 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)=8totient(8)=4totient(4)=2totient(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 ofnext()is merely a search bypred()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$valueis a perfect totient. yes/no, true/false, vibe check passed or not. π«Ά
π SEE ALSO π
Math::NumSeqMath::NumSeq::TotientMath::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
- 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