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 digits "reverse 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.