Math::N...erseAdd(3)

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

πŸ’– Math::NumSeq::ReverseAdd πŸ’–

okay bestie, so this page is Math::N...erseAdd(3) from the User Contributed Perl Documentation collection, and it's literally all about a lil Perl module that does the reverse-add thing. sit down, hydrate, let's go 🫢


✨ NAME ✨

Math::NumSeq::ReverseAdd β€” steps of the reverse-add algorithm 🌸


πŸŽ€ SYNOPSIS πŸŽ€

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

πŸ¦‹ DESCRIPTION πŸ¦‹

So the vibe is: you give it a starting point, and it spits out the reverse-add sequence from there. The whole gimmick is that you take a value, flip its digits around, add the flipped version back to the original, and boom πŸ’₯ that's your next value.

Like for example with start => 1:

1,2,4,8,16,77,154,605,1111,2222,...

watch the magic happen at 16: reverse those digits and you get 61, and then 16+61=77 which is the next value. it's giving ✨ arithmetic ✨

There's some genuine interest in whether you ever hit a palindrome like 77 in the sequence β€” but bestie, the sequence here just keeps going forever and ever, no cap. πŸƒβ€β™€οΈπŸ’¨

Default behavior? Digits get reversed in decimal. But the radix parameter lets you pick a different base if you're feeling spicy. 🌈


πŸ’… FUNCTIONS πŸ’…

Peep "FUNCTIONS" in Math::NumSeq for the behavior that's common to, like, all the sequence classes. πŸ‘‘

  • $seq = Math::NumSeq::ReverseAdd->new (start => $n)
  • $seq = Math::NumSeq::ReverseAdd->new (start => $n, radix => $r) β€” Create and return a new sequence object. new sequence object, who dis πŸ’–

πŸ”’ Random Access πŸ”’

  • $value = $seq->ith($i) β€” Return the *$i*th value in the sequence. just hand it an index, it hands you a value. iconic behavior fr fr πŸŽ€

🌟 SEE ALSO 🌟

  • Math::NumSeq
  • Math::NumSeq::ReverseAddSteps

🏠 HOME PAGE 🏠

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


πŸ“œ 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 of the License, 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/>.

okay real talk for one sec πŸ™ˆ β€” that warranty bit is NOT a joke, it's all caps for a reason. no promises, bestie. read the actual license.

and that's the whole page, periodt πŸ’… this was perl v5.42.0, dated 2025-07-25 β€” ty for coming to my ted talk, mwah πŸ«ΆπŸ’–

πŸ“¦ where this page comes from