NAME

Math::NumSeq::KaprekarNumbers -- recurrence around a square spiral

SYNOPSIS

use Math::NumSeq::KaprekarNumbers;
my $seq = Math::NumSeq::KaprekarNumbers->new (cbrt => 2);
my ($i, $value) = $seq->next;

DESCRIPTION

In progress ...

This is the Kaprekar numbers, those integers where adding the upper and low half of the square gives the integer itself.

1, 9, 45, 55, 99, 297, 703, 999, 2223, 2728, ...

For example 45 is in the sequence because 45*45=2025 and 20+25=45.

In the current code next() is not very efficient, it merely searches all integers testing with pred().

FUNCTIONS

See "FUNCTIONS" in Math::NumSeq for behaviour common to all sequence classes.

$seq = Math::NumSeq::KaprekarNumbers->new ()

Create and return a new sequence object.

$bool = $seq->pred($value)

Return true if $value is a Kaprekar number.

SEE ALSO

Math::NumSeq

HOME PAGE

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

LICENSE

Copyright 2012 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/>.