Math::N...Numbers(3)
π Math::NumSeq::HarshadNumbers(3) β the group chat edition π
okay bestie, so this is the manual page for Math::NumSeq::HarshadNumbers, living in the User Contributed Perl Documentation section (that's the (3) bestie, it's giving library-adjacent β¨). Sit down, hydrate, and let's talk about numbers that are down for their own digit sum. π«Ά
β¨ NAME β¨
Math::NumSeq::HarshadNumbers β numbers divisible by the sum of their digits π
πΈ SYNOPSIS πΈ
use Math::NumSeq::HarshadNumbers;
my $seq = Math::NumSeq::HarshadNumbers->new;
my ($i, $value) = $seq->next;
that's it, that's the whole vibe. make the object, ask for the next pair, get an index and a value. iconic. π
π¦ DESCRIPTION π¦
So the harshad numbers go 1 to 10, then 12, 18, 20, 21, etc. π
What makes a number a harshad number? It's an integer that's divisible by the sum of its digits. That's the whole personality trait. π
Like, 18 is a harshad number because 18 is divisible by its digit sum, which is 1+8=9. math girlies stay winning. πβ¨
π FUNCTIONS π
First off, for the stuff that's common to all the sequence classes, go peek at "FUNCTIONS" in Math::NumSeq. no cap.
$seq = Math::NumSeq::HarshadNumbers->new ()$seq = Math::NumSeq::HarshadNumbers->new (radix => $r)β makes a new sequence object and hands it to you. the optionalradixparameter sets the base used for the digits, and its default is10, aka decimal. slay.$bool = $seq->pred($value)β returns true if$valueis a harshad number, meaning it's divisible by the sum of its digits (in whateverradixyou gave it). it's giving "am I that girl?" and the answer is yes or no, no in-between. π
π SEE ALSO π
Math::NumSeqMath::NumSeq::DigitSumMath::NumSeq::MoranNumbers
the whole friend group, fr fr. π§
π HOME PAGE π
<http://user42.tuxfamily.org/math-numseq/index.html>
go say hi, the vibes are immaculate. β
π 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. π¨ (yes bestie, that's a real all-caps moment, read it carefully, it matters.)
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 one came from perl v5.42.0, dated 2025-07-25, and it lives under the name Math::N...Numbers(3) in your man pages. go forth and divide numbers by their own digit sums, you absolute main character. πβ¨π
π¦ 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