search.cpan.org is shutting down
Kevin Ryde > Math-NumSeq > Math::NumSeq::Xenodromes

Math-NumSeq-72.tar.gz

Dependencies

Annotate this POD

Website

# CPAN RT

 Open 0
View/Report Bugs
Module Version: 72

# NAME

Math::NumSeq::Xenodromes -- integers with all digits unique

# SYNOPSIS

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

# DESCRIPTION

This is integers which have all digits different,

```    0, ..., 9, 10, 12, 13, ..., 19, 20, 21, 23, 24, ...
# starting i=1 value=0```

For example 11 is not in the sequence because it has digit 1 appearing twice.

This is a finite sequence since the maximum value with distinct digits is 9876543210.

The optional `radix` parameter controls the base used for the digits (default decimal). In binary for example there's just three values, 0, 1, 2.

# FUNCTIONS

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

`\$seq = Math::NumSeq::Xenodromes->new ()`
`\$seq = Math::NumSeq::Xenodromes->new (radix => \$integer)`

Create and return a new sequence object.

## Random Access

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

Return the `\$i`'th xenodrome, or `undef` if `\$i` is beyond the end of the sequence.

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

Return true if `\$value` is a xenodrome, ie. an integer with all digits distinct.

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