Kevin Ryde > Math-NumSeq-64 > Math::NumSeq::ConcatNumbers

Math-NumSeq-64.tar.gz

Dependencies

Annotate this POD

Website

CPAN RT

 Open 0
View/Report Bugs
Module Version: 64   Source   Latest Release: Math-NumSeq-69

NAME

Math::NumSeq::ConcatNumbers -- concatenate digits of i, i+1

SYNOPSIS

``` use Math::NumSeq::ConcatNumbers;
my \$seq = Math::NumSeq::ConcatNumbers->new;
my (\$i, \$value) = \$seq->next;```

DESCRIPTION

The concatenation of i and i+1 as digits, starting from i=0,

`    1, 12, 23, 34, 45, 56, 67, 78, 89, 910, 1011, 1112, ...`

The default is decimal, or optional `radix` parameter selects another base.

Since the two i and i+1 usually have the same number of digits, the resulting concatenated value has an even number of digits. The exception is at i=9 i+1=10, or i=99 i+1=100, etc, i=99..99 when the resulting value has an odd number of digits.

Being an even number of digits makes power gaps between for instance 89 and 1011, then 998999 and 10001001.

Concat Count

Option `concat_count => \$c` selects how many of i,i+1,i+2,i+3,etc are concatenated. For example `concat_count => 3` gives

`    12, 123, 234, 345, 456, 567, 678, 789, 8910, 91011, 101112, 111213, ...`

`concat_count => 1` means all integers (the same as Math::NumSeq::All).

FUNCTIONS

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

`\$seq = Math::NumSeq::ConcatNumbers->new ()`
`\$seq = Math::NumSeq::ConcatNumbers->new (radix => \$r, concat_count => \$c)`

Create and return a new sequence object.

Random Access

`\$value = \$seq->ith(\$i)`

Return the concatenation of `\$i`, `\$i+1`, etc.

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