Math::NumSeq::MaxDigitCount -- maximum of given digit in any radix
use Math::NumSeq::MaxDigitCount; my $seq = Math::NumSeq::MaxDigitCount->new (values_type => 'count'); my ($i, $value) = $seq->next;
In progress ...
The default is the maximum number of zeros which occur when i is written out in any radix,
starting i=1 0, 1, 1, 2, 1, 1, 1, 3, 2, 2, 1, 2, 1, 1, 1, 4, 3, 3, 2, 3, 2, ...
Option values_type => 'radix' gives the radix where the maximum occurs,
values_type => 'radix'
0, 2, 3, 2, 2, 2, 7, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, ...
i=1 has no zeros in any radix and the radix returned is 0. For any higher i there's always at most radix=i for "10" with one zero. But usually some much smaller radix has one or more zeros. Most of the time the maximum occurs in binary or ternary.
See "FUNCTIONS" in Math::NumSeq for behaviour common to all sequence classes.
$seq = Math::NumSeq::MaxDigitCount->new ()
Create and return a new sequence object.
$value = $seq->ith($i)
Return the number of ways $i can be expressed as the sum of two squares.
$i
Math::NumSeq, Math::NumSeq::DigitCount
http://user42.tuxfamily.org/math-numseq/index.html
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/>.
To install Math::NumSeq, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Math::NumSeq
CPAN shell
perl -MCPAN -e shell install Math::NumSeq
For more information on module installation, please visit the detailed CPAN module installation guide.