NAME
App::MathImage::NumSeq::ReverseAddSteps -- steps of the reverse-add algorithm
SYNOPSIS
use App::MathImage::NumSeq::ReverseAddSteps;
my $seq = App::MathImage::NumSeq::ReverseAddSteps->new;
my ($i, $value) = $seq->next;
DESCRIPTION
The number of steps to reach a palindrome by the reverse-digits and add algorithm. For example the i=19 is 3 because 19+91=110, then 110+011=121
FUNCTIONS
$seq = App::MathImage::NumSeq::ReverseAddSteps->new (key=>value,...)
-
Create and return a new sequence object.
$value = $seq->ith($i)
-
Return the number of reverse-add steps required to reach a palindrome. For some numbers this is very large and conjectured to be infinite, so in the current code a limit of 30 is imposed.
$bool = $seq->pred($value)
-
Return true if
$value >= 0
, since any count of steps is possible.
SEE ALSO
Math::NumSeq, Math::NumSeq::Cubes
HOME PAGE
http://user42.tuxfamily.org/math-numseq/index.html
LICENSE
Copyright 2010, 2011 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/>.