Math::N...owerful(3)

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

πŸ’– NAME πŸ’–

Math::NumSeq::Powerful β€” numbers with certain prime powers, bestie πŸ’…


✨ SYNOPSIS ✨

use Math::NumSeq::Powerful;
my $seq = Math::NumSeq::Powerful->new (powerful_type => 'some',
                                       power => 2);
my ($i, $value) = $seq->next;

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so. This is integers with a minimum prime power. That's the whole vibe. The powerful_type option β€” she's a string, btw β€” can be:

  • "some" β€” some exp >= power
  • "all" β€” all exp >= power

The default is "some" and power=2, which means there has to be some prime factor that's a square or higher. Like, at least one. She's not picky like that.

# default powerful_type="some" power=2

4, 8, 9, 12, 16, 18, 20, ...
starting i=1

These are the non-squarefrees πŸ’€ The squarefrees have no square factor at all, and these non-squarefrees have at least one square factor. (Sometimes this gets called "squareful" but that name can get confused with the "all" style, where all the primes have to be a square or better. messy. we don't do that here.)

The "all" option with power=2 demands that all primes are square or higher. no exceptions, periodt.

powerful_type="all" power=2
1, 4, 8, 9, 16, 25, 27, 32, 36, ...

Notice how, for example, 12=2*2*3 is excluded πŸ‘€ because its prime factor 3 is not squared or better. she didn't make the cut. And 1 is included, on the basis that it has no prime factors β€” iconic empty-set behavior, we love her 🌸


πŸŽ€ FUNCTIONS πŸŽ€

See "FUNCTIONS" in Math::NumSeq for behaviour common to all sequence classes. (that's the group chat rules, iykyk)

  • $seq = Math::NumSeq::Powerful->new (powerful_type => $str, power => $integer) β€” Create and return a new sequence object 🫢 powerful_type can be:
    • "some" (the default)
    • "all"

And power must be 2 or more. no zero, no one, don't even try it bestie.

πŸ”₯ Random Access πŸ”₯

  • $bool = $seq->pred($value) β€” Return true if $value has prime powers of the given type. yes/no, true/false, slay/not-slay πŸ’…

🌈 SEE ALSO 🌈

  • Math::NumSeq
  • Math::NumSeq::Squares
  • Math::NumSeq::Cubes
  • Math::NumSeq::PowerPart

🏠 HOME PAGE 🏠

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


πŸ‘‘ LICENSE πŸ‘‘

Copyright 2011, 2012, 2013, 2014, 2015, 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 read the license, it's giving legally binding πŸ’€

okay that's the whole page bestie, and just so you know who's speaking: this is Math::N...owerful(3) from the User Contributed Perl Documentation, running on perl v5.42.0, dated 2025-07-25 πŸ¦‹πŸ’–βœ¨ periodt.

πŸ“¦ where this page comes from