NAME
Math::NumSeq::UndulatingNumbers -- numbers with alternating digits ABABAB...
SYNOPSIS
use Math::NumSeq::UndulatingNumbers;
my $seq = Math::NumSeq::UndulatingNumbers->new (radix => 10);
my ($i, $value) = $seq->next;
DESCRIPTION
This is the sequence of numbers with digits ABABAB... alternating between two values,
0 ... 99,
101, 111, 121, 131, ... 191,
202, 212, 222, 232, ... 292,
...
909, 919, 929, 939, ... 999,
1010, 1111, 1212, ... 1919,
...
Numbers with just 1 or 2 digits are A or AB and are considered of undulating form. This means all numbers up to 99 are undulating.
The default is decimal or the optional radix=>$r
can select another radix.
In binary the only two digits are 0 and 1 and the high digit must be 1, so it ens up being just 101... and 111...
0, 1, 10, 11, 101, 111, 1010, 1111, 10101, 11111, ...
(in binary)
FUNCTIONS
See "FUNCTIONS" in Math::NumSeq for behaviour common to all sequence classes.
$seq = Math::NumSeq::UndulatingNumbers->new ()
$seq = Math::NumSeq::UndulatingNumbers->new (radix => $r)
-
Create and return a new sequence object. The default radix is 10.
$bool = $seq->pred($value)
-
Return true if
$value
is an undulating number, ie. has digits of the form ABABAB... $i = $seq->value_to_i_floor($value)
$i = $seq->value_to_i_estimate($value)
-
Return the i for the undulating number <= $value.
SEE ALSO
HOME PAGE
http://user42.tuxfamily.org/math-numseq/index.html
LICENSE
Copyright 2010, 2011, 2012, 2013, 2014, 2016, 2019 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/>.