1Math::NumSeq::UndulatinUgsNeurmbCeornst(r3i)buted Perl DMoactuhm:e:nNtuamtSieoqn::UndulatingNumbers(3)
2
3
4
6 Math::NumSeq::UndulatingNumbers -- numbers with alternating digits
7 ABABAB...
8
10 use Math::NumSeq::UndulatingNumbers;
11 my $seq = Math::NumSeq::UndulatingNumbers->new (radix => 10);
12 my ($i, $value) = $seq->next;
13
15 This is the sequence of numbers with digits ABABAB... alternating
16 between two values,
17
18 0 ... 99,
19 101, 111, 121, 131, ... 191,
20 202, 212, 222, 232, ... 292,
21 ...
22 909, 919, 929, 939, ... 999,
23 1010, 1111, 1212, ... 1919,
24 ...
25
26 Numbers with just 1 or 2 digits are A or AB and are considered of
27 undulating form. This means all numbers up to 99 are undulating.
28
29 The default is decimal or the optional "radix=>$r" can select another
30 radix.
31
32 In binary the only two digits are 0 and 1 and the high digit must be 1,
33 so it ens up being just 101... and 111...
34
35 0, 1, 10, 11, 101, 111, 1010, 1111, 10101, 11111, ...
36 (in binary)
37
39 See "FUNCTIONS" in Math::NumSeq for behaviour common to all sequence
40 classes.
41
42 "$seq = Math::NumSeq::UndulatingNumbers->new ()"
43 "$seq = Math::NumSeq::UndulatingNumbers->new (radix => $r)"
44 Create and return a new sequence object. The default radix is 10.
45
46 "$bool = $seq->pred($value)"
47 Return true if $value is an undulating number, ie. has digits of
48 the form ABABAB...
49
50 "$i = $seq->value_to_i_floor($value)"
51 "$i = $seq->value_to_i_estimate($value)"
52 Return the i for the undulating number <= $value.
53
55 Math::NumSeq
56
58 <http://user42.tuxfamily.org/math-numseq/index.html>
59
61 Copyright 2010, 2011, 2012, 2013, 2014, 2016 Kevin Ryde
62
63 Math-NumSeq is free software; you can redistribute it and/or modify it
64 under the terms of the GNU General Public License as published by the
65 Free Software Foundation; either version 3, or (at your option) any
66 later version.
67
68 Math-NumSeq is distributed in the hope that it will be useful, but
69 WITHOUT ANY WARRANTY; without even the implied warranty of
70 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
71 General Public License for more details.
72
73 You should have received a copy of the GNU General Public License along
74 with Math-NumSeq. If not, see <http://www.gnu.org/licenses/>.
75
76
77
78perl v5.30.1 2020-01-30Math::NumSeq::UndulatingNumbers(3)