Math::N...Numbers(3)

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

πŸ’– 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 optional radix parameter sets the base used for the digits, and its default is 10, aka decimal. slay.
  • $bool = $seq->pred($value) β€” returns true if $value is a harshad number, meaning it's divisible by the sum of its digits (in whatever radix you gave it). it's giving "am I that girl?" and the answer is yes or no, no in-between. πŸ’…

🌈 SEE ALSO 🌈

  • Math::NumSeq
  • Math::NumSeq::DigitSum
  • Math::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